<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998


The @match@ function
-}</span><span>
</span><span id="line-8"></span><span>
</span><span id="line-9"></span><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-10"></span><span class="hs-pragma">{-# LANGUAGE MonadComprehensions #-}</span><span>
</span><span id="line-11"></span><span class="hs-pragma">{-# LANGUAGE OverloadedLists #-}</span><span>
</span><span id="line-12"></span><span class="hs-pragma">{-# LANGUAGE TypeFamilies #-}</span><span>
</span><span id="line-13"></span><span class="hs-pragma">{-# LANGUAGE ViewPatterns #-}</span><span>
</span><span id="line-14"></span><span>
</span><span id="line-15"></span><span class="hs-pragma">{-# OPTIONS_GHC -Wno-incomplete-uni-patterns   #-}</span><span>
</span><span id="line-16"></span><span class="hs-pragma">{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}</span><span>
</span><span id="line-17"></span><span>
</span><span id="line-18"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.HsToCore.Match</span><span>
</span><span id="line-19"></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.html#match"><span class="hs-identifier">match</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.html#matchEquations"><span class="hs-identifier">matchEquations</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.html#matchWrapper"><span class="hs-identifier">matchWrapper</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.html#matchSimply"><span class="hs-identifier">matchSimply</span></a></span><span>
</span><span id="line-20"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.html#matchSinglePat"><span class="hs-identifier">matchSinglePat</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.html#matchSinglePatVar"><span class="hs-identifier">matchSinglePatVar</span></a></span><span>
</span><span id="line-21"></span><span>   </span><span class="hs-special">)</span><span>
</span><span id="line-22"></span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#"><span class="hs-identifier">GHC.Platform</span></a></span><span>
</span><span id="line-28"></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="hs-pragma">{-#SOURCE</span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><a href="GHC.HsToCore.Expr.html"><span class="hs-identifier">GHC.HsToCore.Expr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier">dsLExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Expr.html#dsSyntaxExpr"><span class="hs-identifier">dsSyntaxExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-30"></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Origin"><span class="hs-identifier">Origin</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Hs.html"><span class="hs-identifier">GHC.Hs</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Zonk.html"><span class="hs-identifier">GHC.Tc.Utils.Zonk</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html"><span class="hs-identifier">GHC.Tc.Types.Evidence</span></a></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html"><span class="hs-identifier">GHC.Tc.Utils.Monad</span></a></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.html"><span class="hs-identifier">GHC.HsToCore.PmCheck</span></a></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.html"><span class="hs-identifier">GHC.Core</span></a></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Literal.html"><span class="hs-identifier">GHC.Types.Literal</span></a></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Utils.html"><span class="hs-identifier">GHC.Core.Utils</span></a></span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Make.html"><span class="hs-identifier">GHC.Core.Make</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html"><span class="hs-identifier">GHC.HsToCore.Monad</span></a></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.Binds.html"><span class="hs-identifier">GHC.HsToCore.Binds</span></a></span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.GuardedRHSs.html"><span class="hs-identifier">GHC.HsToCore.GuardedRHSs</span></a></span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.Utils.html"><span class="hs-identifier">GHC.HsToCore.Utils</span></a></span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.ConLike.html"><span class="hs-identifier">GHC.Core.ConLike</span></a></span><span>
</span><span id="line-48"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html"><span class="hs-identifier">GHC.Core.DataCon</span></a></span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html"><span class="hs-identifier">GHC.Core.PatSyn</span></a></span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.Constructor.html"><span class="hs-identifier">GHC.HsToCore.Match.Constructor</span></a></span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html"><span class="hs-identifier">GHC.HsToCore.Match.Literal</span></a></span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Coercion.html"><span class="hs-identifier">GHC.Core.Coercion</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Coercion.html#eqCoercion"><span class="hs-identifier">eqCoercion</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-54"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html"><span class="hs-identifier">GHC.Core.TyCon</span></a></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isNewTyCon"><span class="hs-identifier">isNewTyCon</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Multiplicity.html"><span class="hs-identifier">GHC.Core.Multiplicity</span></a></span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html"><span class="hs-identifier">GHC.Builtin.Types</span></a></span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Maybe.html"><span class="hs-identifier">GHC.Data.Maybe</span></a></span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>
</span><span id="line-61"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-62"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#isGenerated"><span class="hs-identifier">isGenerated</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#il_value"><span class="hs-identifier">il_value</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#fl_value"><span class="hs-identifier">fl_value</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Boxity"><span class="hs-identifier">Boxity</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-63"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-64"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html"><span class="hs-identifier">GHC.Types.Unique</span></a></span><span>
</span><span id="line-65"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html"><span class="hs-identifier">GHC.Types.Unique.DFM</span></a></span><span>
</span><span id="line-66"></span><span>
</span><span id="line-67"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier">unless</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-68"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.NonEmpty.html#"><span class="hs-identifier">Data.List.NonEmpty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier">NonEmpty</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-69"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Data.List.NonEmpty.html#"><span class="hs-identifier">Data.List.NonEmpty</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">NEL</span></span><span>
</span><span id="line-70"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.html#"><span class="hs-identifier">Data.Map</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Map</span></span><span>
</span><span id="line-71"></span><span>
</span><span id="line-72"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                The main matching function
*                                                                      *
************************************************************************

The function @match@ is basically the same as in the Wadler chapter
from &quot;The Implementation of Functional Programming Languages&quot;,
except it is monadised, to carry around the name supply, info about
annotations, etc.

Notes on @match@'s arguments, assuming $m$ equations and $n$ patterns:
\begin{enumerate}
\item
A list of $n$ variable names, those variables presumably bound to the
$n$ expressions being matched against the $n$ patterns.  Using the
list of $n$ expressions as the first argument showed no benefit and
some inelegance.

\item
The second argument, a list giving the ``equation info'' for each of
the $m$ equations:
\begin{itemize}
\item
the $n$ patterns for that equation, and
\item
a list of Core bindings [@(Id, CoreExpr)@ pairs] to be ``stuck on
the front'' of the matching code, as in:
\begin{verbatim}
let &lt;binds&gt;
in  &lt;matching-code&gt;
\end{verbatim}
\item
and finally: (ToDo: fill in)

The right way to think about the ``after-match function'' is that it
is an embryonic @CoreExpr@ with a ``hole'' at the end for the
final ``else expression''.
\end{itemize}

There is a data type, @EquationInfo@, defined in module @GHC.HsToCore.Monad@.

An experiment with re-ordering this information about equations (in
particular, having the patterns available in column-major order)
showed no benefit.

\item
A default expression---what to evaluate if the overall pattern-match
fails.  This expression will (almost?) always be
a measly expression @Var@, unless we know it will only be used once
(as we do in @glue_success_exprs@).

Leaving out this third argument to @match@ (and slamming in lots of
@Var &quot;fail&quot;@s) is a positively {\em bad} idea, because it makes it
impossible to share the default expressions.  (Also, it stands no
chance of working in our post-upheaval world of @Locals@.)
\end{enumerate}

Note: @match@ is often called via @matchWrapper@ (end of this module),
a function that does much of the house-keeping that goes with a call
to @match@.

It is also worth mentioning the {\em typical} way a block of equations
is desugared with @match@.  At each stage, it is the first column of
patterns that is examined.  The steps carried out are roughly:
\begin{enumerate}
\item
Tidy the patterns in column~1 with @tidyEqnInfo@ (this may add
bindings to the second component of the equation-info):
\item
Now {\em unmix} the equations into {\em blocks} [w\/ local function
@match_groups@], in which the equations in a block all have the same
 match group.
(see ``the mixture rule'' in SLPJ).
\item
Call the right match variant on each block of equations; it will do the
appropriate thing for each kind of column-1 pattern.
\end{enumerate}

We are a little more paranoid about the ``empty rule'' (SLPJ, p.~87)
than the Wadler-chapter code for @match@ (p.~93, first @match@ clause).
And gluing the ``success expressions'' together isn't quite so pretty.

This  @match@ uses @tidyEqnInfo@
to get `as'- and `twiddle'-patterns out of the way (tidying), before
applying ``the mixture rule'' (SLPJ, p.~88) [which really {\em
un}mixes the equations], producing a list of equation-info
blocks, each block having as its first column patterns compatible with each other.

Note [Match Ids]
~~~~~~~~~~~~~~~~
Most of the matching functions take an Id or [Id] as argument.  This Id
is the scrutinee(s) of the match. The desugared expression may
sometimes use that Id in a local binding or as a case binder.  So it
should not have an External name; Lint rejects non-top-level binders
with External names (#13043).

See also Note [Localise pattern binders] in GHC.HsToCore.Utils
-}</span><span>
</span><span id="line-172"></span><span>
</span><span id="line-173"></span><span class="hs-keyword">type</span><span> </span><span id="MatchId"><span class="annot"><a href="GHC.HsToCore.Match.html#MatchId"><span class="hs-identifier hs-var">MatchId</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>   </span><span class="hs-comment">-- See Note [Match Ids]</span><span>
</span><span id="line-174"></span><span>
</span><span id="line-175"></span><span class="annot"><a href="GHC.HsToCore.Match.html#match"><span class="hs-identifier hs-type">match</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.HsToCore.Match.html#MatchId"><span class="hs-identifier hs-type">MatchId</span></a></span><span class="hs-special">]</span><span>        </span><span class="hs-comment">-- ^ Variables rep\'ing the exprs we\'re matching with</span><span>
</span><span id="line-176"></span><span>                          </span><span class="hs-comment">-- ^ See Note [Match Ids]</span><span>
</span><span id="line-177"></span><span>                          </span><span class="hs-comment">--</span><span>
</span><span id="line-178"></span><span>                          </span><span class="hs-comment">-- ^ Note that the Match Ids carry not only a name, but</span><span>
</span><span id="line-179"></span><span>                          </span><span class="hs-comment">-- ^ also the multiplicity at which each column has been</span><span>
</span><span id="line-180"></span><span>                          </span><span class="hs-comment">-- ^ type checked.</span><span>
</span><span id="line-181"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>             </span><span class="hs-comment">-- ^ Type of the case expression</span><span>
</span><span id="line-182"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span class="hs-special">]</span><span>   </span><span class="hs-comment">-- ^ Info about patterns, etc. (type synonym below)</span><span>
</span><span id="line-183"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Monad.html#MatchResult"><span class="hs-identifier hs-type">MatchResult</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ Desugared result!</span><span>
</span><span id="line-184"></span><span>
</span><span id="line-185"></span><span id="match"><span class="annot"><span class="annottext">match :: [Id] -&gt; Kind -&gt; [EquationInfo] -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#match"><span class="hs-identifier hs-var hs-var">match</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span id="local-6989586621681144012"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681144012"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681144011"><span class="annot"><span class="annottext">[EquationInfo]
</span><a href="#local-6989586621681144011"><span class="hs-identifier hs-var">eqns</span></a></span></span><span>
</span><span id="line-186"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT2</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">not</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">null</span><span> </span><span class="hs-identifier">eqns</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">ty</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-187"></span><span>    </span><span class="annot"><span class="annottext">MatchResult CoreExpr -&gt; DsM (MatchResult CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(MatchResult CoreExpr
 -&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr)
-&gt; [MatchResult CoreExpr] -&gt; MatchResult CoreExpr
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; a -&gt; a) -&gt; t a -&gt; a
</span><a href="../../base/src/Data.Foldable.html#foldr1"><span class="hs-identifier hs-var">foldr1</span></a></span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
-&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr
</span><a href="GHC.HsToCore.Utils.html#combineMatchResults"><span class="hs-identifier hs-var">combineMatchResults</span></a></span><span> </span><span class="annot"><span class="annottext">[MatchResult CoreExpr]
</span><a href="#local-6989586621681144002"><span class="hs-identifier hs-var">match_results</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-188"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-189"></span><span>    </span><span id="local-6989586621681144002"><span class="annot"><span class="annottext">match_results :: [MatchResult CoreExpr]
</span><a href="#local-6989586621681144002"><span class="hs-identifier hs-var hs-var">match_results</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">null</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">eqn_pats</span><span> </span><span class="hs-identifier">eqn</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-190"></span><span>                      </span><span class="annot"><span class="annottext">EquationInfo -&gt; MatchResult CoreExpr
</span><a href="GHC.HsToCore.Monad.html#eqn_rhs"><span class="hs-identifier hs-var hs-var">eqn_rhs</span></a></span><span> </span><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681144000"><span class="hs-identifier hs-var">eqn</span></a></span><span>
</span><span id="line-191"></span><span>                    </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681144000"><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681144000"><span class="hs-identifier hs-var">eqn</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[EquationInfo]
</span><a href="#local-6989586621681144011"><span class="hs-identifier hs-var">eqns</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-192"></span><span>
</span><span id="line-193"></span><span class="annot"><a href="GHC.HsToCore.Match.html#match"><span class="hs-identifier hs-var">match</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681143997"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143997"><span class="hs-identifier hs-var">v</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681143996"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681143996"><span class="hs-identifier hs-var">vs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681143995"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143995"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681143994"><span class="annot"><span class="annottext">[EquationInfo]
</span><a href="#local-6989586621681143994"><span class="hs-identifier hs-var">eqns</span></a></span></span><span>    </span><span class="hs-comment">-- Eqns *can* be empty</span><span>
</span><span id="line-194"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT2</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">all</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">isInternalName</span><span> </span><span class="hs-operator">.</span><span> </span><span class="hs-identifier">idName</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">vars</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">vars</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-195"></span><span>    </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681143988"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681143988"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env DsGblEnv DsLclEnv) DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-196"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681143986"><span class="annot"><span class="annottext">platform :: Platform
</span><a href="#local-6989586621681143986"><span class="hs-identifier hs-var hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681143988"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-197"></span><span>                </span><span class="hs-comment">-- Tidy the first pattern, generating</span><span>
</span><span id="line-198"></span><span>                </span><span class="hs-comment">-- auxiliary bindings if necessary</span><span>
</span><span id="line-199"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681143984"><span class="annot"><span class="annottext">[DsWrapper]
</span><a href="#local-6989586621681143984"><span class="hs-identifier hs-var">aux_binds</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681143983"><span class="annot"><span class="annottext">[EquationInfo]
</span><a href="#local-6989586621681143983"><span class="hs-identifier hs-var">tidy_eqns</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(EquationInfo
 -&gt; IOEnv (Env DsGblEnv DsLclEnv) (DsWrapper, EquationInfo))
-&gt; [EquationInfo]
-&gt; IOEnv (Env DsGblEnv DsLclEnv) ([DsWrapper], [EquationInfo])
forall (m :: * -&gt; *) a b c.
Applicative m =&gt;
(a -&gt; m (b, c)) -&gt; [a] -&gt; m ([b], [c])
</span><a href="../../base/src/Control.Monad.html#mapAndUnzipM"><span class="hs-identifier hs-var">mapAndUnzipM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
-&gt; EquationInfo
-&gt; IOEnv (Env DsGblEnv DsLclEnv) (DsWrapper, EquationInfo)
</span><a href="GHC.HsToCore.Match.html#tidyEqnInfo"><span class="hs-identifier hs-var">tidyEqnInfo</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143997"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[EquationInfo]
</span><a href="#local-6989586621681143994"><span class="hs-identifier hs-var">eqns</span></a></span><span>
</span><span id="line-200"></span><span>                </span><span class="hs-comment">-- Group the equations and match each group in turn</span><span>
</span><span id="line-201"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681143980"><span class="annot"><span class="annottext">grouped :: [NonEmpty (PatGroup, EquationInfo)]
</span><a href="#local-6989586621681143980"><span class="hs-identifier hs-var hs-var">grouped</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; [EquationInfo] -&gt; [NonEmpty (PatGroup, EquationInfo)]
</span><a href="GHC.HsToCore.Match.html#groupEquations"><span class="hs-identifier hs-var">groupEquations</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681143986"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">[EquationInfo]
</span><a href="#local-6989586621681143983"><span class="hs-identifier hs-var">tidy_eqns</span></a></span><span>
</span><span id="line-202"></span><span>
</span><span id="line-203"></span><span>         </span><span class="hs-comment">-- print the view patterns that are commoned up to help debug</span><span>
</span><span id="line-204"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">DumpFlag
-&gt; TcRnIf DsGblEnv DsLclEnv () -&gt; TcRnIf DsGblEnv DsLclEnv ()
forall gbl lcl. DumpFlag -&gt; TcRnIf gbl lcl () -&gt; TcRnIf gbl lcl ()
</span><a href="GHC.Tc.Utils.Monad.html#whenDOptM"><span class="hs-identifier hs-var">whenDOptM</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="GHC.Driver.Flags.html#Opt_D_dump_view_pattern_commoning"><span class="hs-identifier hs-var">Opt_D_dump_view_pattern_commoning</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[NonEmpty (PatGroup, EquationInfo)] -&gt; TcRnIf DsGblEnv DsLclEnv ()
forall {t :: * -&gt; *} {b}.
Foldable t =&gt;
[t (PatGroup, b)] -&gt; TcRnIf DsGblEnv DsLclEnv ()
</span><a href="#local-6989586621681143976"><span class="hs-identifier hs-var">debug</span></a></span><span> </span><span class="annot"><span class="annottext">[NonEmpty (PatGroup, EquationInfo)]
</span><a href="#local-6989586621681143980"><span class="hs-identifier hs-var">grouped</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-205"></span><span>
</span><span id="line-206"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681143975"><span class="annot"><span class="annottext">NonEmpty (MatchResult CoreExpr)
</span><a href="#local-6989586621681143975"><span class="hs-identifier hs-var">match_results</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[NonEmpty (PatGroup, EquationInfo)]
-&gt; DsM (NonEmpty (MatchResult CoreExpr))
</span><a href="#local-6989586621681143974"><span class="hs-identifier hs-var">match_groups</span></a></span><span> </span><span class="annot"><span class="annottext">[NonEmpty (PatGroup, EquationInfo)]
</span><a href="#local-6989586621681143980"><span class="hs-identifier hs-var">grouped</span></a></span><span>
</span><span id="line-207"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr -&gt; DsM (MatchResult CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(MatchResult CoreExpr -&gt; DsM (MatchResult CoreExpr))
-&gt; MatchResult CoreExpr -&gt; DsM (MatchResult CoreExpr)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(DsWrapper -&gt; DsWrapper -&gt; DsWrapper)
-&gt; DsWrapper -&gt; [DsWrapper] -&gt; DsWrapper
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">DsWrapper -&gt; DsWrapper -&gt; DsWrapper
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">(.)</span></a></span><span> </span><span class="annot"><span class="annottext">DsWrapper
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">[DsWrapper]
</span><a href="#local-6989586621681143984"><span class="hs-identifier hs-var">aux_binds</span></a></span><span> </span><span class="annot"><span class="annottext">DsWrapper -&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span>
</span><span id="line-208"></span><span>            </span><span class="annot"><span class="annottext">(MatchResult CoreExpr
 -&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr)
-&gt; NonEmpty (MatchResult CoreExpr) -&gt; MatchResult CoreExpr
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; a -&gt; a) -&gt; t a -&gt; a
</span><a href="../../base/src/Data.Foldable.html#foldr1"><span class="hs-identifier hs-var">foldr1</span></a></span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
-&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr
</span><a href="GHC.HsToCore.Utils.html#combineMatchResults"><span class="hs-identifier hs-var">combineMatchResults</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (MatchResult CoreExpr)
</span><a href="#local-6989586621681143975"><span class="hs-identifier hs-var">match_results</span></a></span><span>
</span><span id="line-209"></span><span>        </span><span class="hs-special">}</span><span>
</span><span id="line-210"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-211"></span><span>    </span><span id="local-6989586621681143989"><span class="annot"><span class="annottext">vars :: NonEmpty Id
</span><a href="#local-6989586621681143989"><span class="hs-identifier hs-var hs-var">vars</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143997"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; [Id] -&gt; NonEmpty Id
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="../../base/src/GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681143996"><span class="hs-identifier hs-var">vs</span></a></span><span>
</span><span id="line-212"></span><span>
</span><span id="line-213"></span><span>    </span><span id="local-6989586621681144469"><span class="annot"><a href="#local-6989586621681143969"><span class="hs-identifier hs-type">dropGroup</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681144469"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681144469"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Match.html#PatGroup"><span class="hs-identifier hs-type">PatGroup</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681144469"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span></span><span>
</span><span id="line-214"></span><span>    </span><span id="local-6989586621681143969"><span class="annot"><span class="annottext">dropGroup :: forall (f :: * -&gt; *).
Functor f =&gt;
f (PatGroup, EquationInfo) -&gt; f EquationInfo
</span><a href="#local-6989586621681143969"><span class="hs-identifier hs-var hs-var">dropGroup</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((PatGroup, EquationInfo) -&gt; EquationInfo)
-&gt; f (PatGroup, EquationInfo) -&gt; f EquationInfo
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">(PatGroup, EquationInfo) -&gt; EquationInfo
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span>
</span><span id="line-215"></span><span>
</span><span id="line-216"></span><span>    </span><span class="annot"><a href="#local-6989586621681143974"><span class="hs-identifier hs-type">match_groups</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Match.html#PatGroup"><span class="hs-identifier hs-type">PatGroup</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Monad.html#MatchResult"><span class="hs-identifier hs-type">MatchResult</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-217"></span><span>    </span><span class="hs-comment">-- Result list of [MatchResult CoreExpr] is always non-empty</span><span>
</span><span id="line-218"></span><span>    </span><span id="local-6989586621681143974"><span class="annot"><span class="annottext">match_groups :: [NonEmpty (PatGroup, EquationInfo)]
-&gt; DsM (NonEmpty (MatchResult CoreExpr))
</span><a href="#local-6989586621681143974"><span class="hs-identifier hs-var hs-var">match_groups</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Kind -&gt; DsM (NonEmpty (MatchResult CoreExpr))
</span><a href="GHC.HsToCore.Match.html#matchEmpty"><span class="hs-identifier hs-var">matchEmpty</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143997"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143995"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-219"></span><span>    </span><span class="annot"><a href="#local-6989586621681143974"><span class="hs-identifier hs-var">match_groups</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681143965"><span class="annot"><span class="annottext">NonEmpty (PatGroup, EquationInfo)
</span><a href="#local-6989586621681143965"><span class="hs-identifier hs-var">g</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681143964"><span class="annot"><span class="annottext">[NonEmpty (PatGroup, EquationInfo)]
</span><a href="#local-6989586621681143964"><span class="hs-identifier hs-var">gs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(NonEmpty (PatGroup, EquationInfo) -&gt; DsM (MatchResult CoreExpr))
-&gt; NonEmpty (NonEmpty (PatGroup, EquationInfo))
-&gt; DsM (NonEmpty (MatchResult CoreExpr))
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (PatGroup, EquationInfo) -&gt; DsM (MatchResult CoreExpr)
</span><a href="#local-6989586621681143962"><span class="hs-identifier hs-var">match_group</span></a></span><span> </span><span class="annot"><span class="annottext">(NonEmpty (NonEmpty (PatGroup, EquationInfo))
 -&gt; DsM (NonEmpty (MatchResult CoreExpr)))
-&gt; NonEmpty (NonEmpty (PatGroup, EquationInfo))
-&gt; DsM (NonEmpty (MatchResult CoreExpr))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (PatGroup, EquationInfo)
</span><a href="#local-6989586621681143965"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (PatGroup, EquationInfo)
-&gt; [NonEmpty (PatGroup, EquationInfo)]
-&gt; NonEmpty (NonEmpty (PatGroup, EquationInfo))
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="../../base/src/GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span> </span><span class="annot"><span class="annottext">[NonEmpty (PatGroup, EquationInfo)]
</span><a href="#local-6989586621681143964"><span class="hs-identifier hs-var">gs</span></a></span><span>
</span><span id="line-220"></span><span>
</span><span id="line-221"></span><span>    </span><span class="annot"><a href="#local-6989586621681143962"><span class="hs-identifier hs-type">match_group</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Match.html#PatGroup"><span class="hs-identifier hs-type">PatGroup</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Monad.html#MatchResult"><span class="hs-identifier hs-type">MatchResult</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-222"></span><span>    </span><span id="local-6989586621681143962"><span class="annot"><span class="annottext">match_group :: NonEmpty (PatGroup, EquationInfo) -&gt; DsM (MatchResult CoreExpr)
</span><a href="#local-6989586621681143962"><span class="hs-identifier hs-var hs-var">match_group</span></a></span></span><span> </span><span id="local-6989586621681143961"><span class="annot"><span class="annottext">eqns :: NonEmpty (PatGroup, EquationInfo)
</span><a href="#local-6989586621681143961"><span class="hs-identifier hs-var">eqns</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621681143960"><span class="annot"><span class="annottext">PatGroup
</span><a href="#local-6989586621681143960"><span class="hs-identifier hs-var">group</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">EquationInfo
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span class="annot"><span class="annottext">[(PatGroup, EquationInfo)]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>
</span><span id="line-223"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">PatGroup
</span><a href="#local-6989586621681143960"><span class="hs-identifier hs-var">group</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-224"></span><span>            </span><span class="annot"><a href="GHC.HsToCore.Match.html#PgCon"><span class="hs-identifier hs-type">PgCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NonEmpty Id
-&gt; Kind
-&gt; NonEmpty (NonEmpty EquationInfo)
-&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.Constructor.html#matchConFamily"><span class="hs-identifier hs-var">matchConFamily</span></a></span><span>  </span><span class="annot"><span class="annottext">NonEmpty Id
</span><a href="#local-6989586621681143989"><span class="hs-identifier hs-var">vars</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143995"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[NonEmpty EquationInfo] -&gt; NonEmpty (NonEmpty EquationInfo)
forall {a}. [a] -&gt; NonEmpty a
</span><a href="#local-6989586621681143957"><span class="hs-identifier hs-var">ne</span></a></span><span> </span><span class="annot"><span class="annottext">([NonEmpty EquationInfo] -&gt; NonEmpty (NonEmpty EquationInfo))
-&gt; [NonEmpty EquationInfo] -&gt; NonEmpty (NonEmpty EquationInfo)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[(DataCon, EquationInfo)] -&gt; [NonEmpty EquationInfo]
forall a.
Uniquable a =&gt;
[(a, EquationInfo)] -&gt; [NonEmpty EquationInfo]
</span><a href="GHC.HsToCore.Match.html#subGroupUniq"><span class="hs-identifier hs-var">subGroupUniq</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681143955"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681143954"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Match.html#PgCon"><span class="hs-identifier hs-type">PgCon</span></a></span><span> </span><span id="local-6989586621681143955"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681143955"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681143954"><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681143954"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(PatGroup, EquationInfo)]
</span><a href="#local-6989586621681143953"><span class="hs-identifier hs-var">eqns'</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-225"></span><span>            </span><span class="annot"><a href="GHC.HsToCore.Match.html#PgSyn"><span class="hs-identifier hs-type">PgSyn</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NonEmpty Id
-&gt; Kind -&gt; NonEmpty EquationInfo -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.Constructor.html#matchPatSyn"><span class="hs-identifier hs-var">matchPatSyn</span></a></span><span>     </span><span class="annot"><span class="annottext">NonEmpty Id
</span><a href="#local-6989586621681143989"><span class="hs-identifier hs-var">vars</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143995"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NonEmpty (PatGroup, EquationInfo) -&gt; NonEmpty EquationInfo
forall (f :: * -&gt; *).
Functor f =&gt;
f (PatGroup, EquationInfo) -&gt; f EquationInfo
</span><a href="#local-6989586621681143969"><span class="hs-identifier hs-var">dropGroup</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (PatGroup, EquationInfo)
</span><a href="#local-6989586621681143961"><span class="hs-identifier hs-var">eqns</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-226"></span><span>            </span><span class="annot"><a href="GHC.HsToCore.Match.html#PgLit"><span class="hs-identifier hs-type">PgLit</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NonEmpty Id
-&gt; Kind
-&gt; NonEmpty (NonEmpty EquationInfo)
-&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.Literal.html#matchLiterals"><span class="hs-identifier hs-var">matchLiterals</span></a></span><span>   </span><span class="annot"><span class="annottext">NonEmpty Id
</span><a href="#local-6989586621681143989"><span class="hs-identifier hs-var">vars</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143995"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[NonEmpty EquationInfo] -&gt; NonEmpty (NonEmpty EquationInfo)
forall {a}. [a] -&gt; NonEmpty a
</span><a href="#local-6989586621681143957"><span class="hs-identifier hs-var">ne</span></a></span><span> </span><span class="annot"><span class="annottext">([NonEmpty EquationInfo] -&gt; NonEmpty (NonEmpty EquationInfo))
-&gt; [NonEmpty EquationInfo] -&gt; NonEmpty (NonEmpty EquationInfo)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[(Literal, EquationInfo)] -&gt; [NonEmpty EquationInfo]
forall a. Ord a =&gt; [(a, EquationInfo)] -&gt; [NonEmpty EquationInfo]
</span><a href="GHC.HsToCore.Match.html#subGroupOrd"><span class="hs-identifier hs-var">subGroupOrd</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621681143947"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681143946"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Match.html#PgLit"><span class="hs-identifier hs-type">PgLit</span></a></span><span> </span><span id="local-6989586621681143947"><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621681143947"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681143946"><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681143946"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(PatGroup, EquationInfo)]
</span><a href="#local-6989586621681143953"><span class="hs-identifier hs-var">eqns'</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-227"></span><span>            </span><span class="annot"><span class="annottext">PatGroup
</span><a href="GHC.HsToCore.Match.html#PgAny"><span class="hs-identifier hs-var">PgAny</span></a></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NonEmpty Id
-&gt; Kind -&gt; NonEmpty EquationInfo -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#matchVariables"><span class="hs-identifier hs-var">matchVariables</span></a></span><span>  </span><span class="annot"><span class="annottext">NonEmpty Id
</span><a href="#local-6989586621681143989"><span class="hs-identifier hs-var">vars</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143995"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NonEmpty (PatGroup, EquationInfo) -&gt; NonEmpty EquationInfo
forall (f :: * -&gt; *).
Functor f =&gt;
f (PatGroup, EquationInfo) -&gt; f EquationInfo
</span><a href="#local-6989586621681143969"><span class="hs-identifier hs-var">dropGroup</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (PatGroup, EquationInfo)
</span><a href="#local-6989586621681143961"><span class="hs-identifier hs-var">eqns</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-228"></span><span>            </span><span class="annot"><a href="GHC.HsToCore.Match.html#PgN"><span class="hs-identifier hs-type">PgN</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NonEmpty Id
-&gt; Kind -&gt; NonEmpty EquationInfo -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.Literal.html#matchNPats"><span class="hs-identifier hs-var">matchNPats</span></a></span><span>      </span><span class="annot"><span class="annottext">NonEmpty Id
</span><a href="#local-6989586621681143989"><span class="hs-identifier hs-var">vars</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143995"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NonEmpty (PatGroup, EquationInfo) -&gt; NonEmpty EquationInfo
forall (f :: * -&gt; *).
Functor f =&gt;
f (PatGroup, EquationInfo) -&gt; f EquationInfo
</span><a href="#local-6989586621681143969"><span class="hs-identifier hs-var">dropGroup</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (PatGroup, EquationInfo)
</span><a href="#local-6989586621681143961"><span class="hs-identifier hs-var">eqns</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-229"></span><span>            </span><span class="annot"><a href="GHC.HsToCore.Match.html#PgOverS"><span class="hs-identifier hs-type">PgOverS</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NonEmpty Id
-&gt; Kind -&gt; NonEmpty EquationInfo -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.Literal.html#matchNPats"><span class="hs-identifier hs-var">matchNPats</span></a></span><span>      </span><span class="annot"><span class="annottext">NonEmpty Id
</span><a href="#local-6989586621681143989"><span class="hs-identifier hs-var">vars</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143995"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NonEmpty (PatGroup, EquationInfo) -&gt; NonEmpty EquationInfo
forall (f :: * -&gt; *).
Functor f =&gt;
f (PatGroup, EquationInfo) -&gt; f EquationInfo
</span><a href="#local-6989586621681143969"><span class="hs-identifier hs-var">dropGroup</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (PatGroup, EquationInfo)
</span><a href="#local-6989586621681143961"><span class="hs-identifier hs-var">eqns</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-230"></span><span>            </span><span class="annot"><a href="GHC.HsToCore.Match.html#PgNpK"><span class="hs-identifier hs-type">PgNpK</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NonEmpty Id
-&gt; Kind -&gt; NonEmpty EquationInfo -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.Literal.html#matchNPlusKPats"><span class="hs-identifier hs-var">matchNPlusKPats</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty Id
</span><a href="#local-6989586621681143989"><span class="hs-identifier hs-var">vars</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143995"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NonEmpty (PatGroup, EquationInfo) -&gt; NonEmpty EquationInfo
forall (f :: * -&gt; *).
Functor f =&gt;
f (PatGroup, EquationInfo) -&gt; f EquationInfo
</span><a href="#local-6989586621681143969"><span class="hs-identifier hs-var">dropGroup</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (PatGroup, EquationInfo)
</span><a href="#local-6989586621681143961"><span class="hs-identifier hs-var">eqns</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-231"></span><span>            </span><span class="annot"><span class="annottext">PatGroup
</span><a href="GHC.HsToCore.Match.html#PgBang"><span class="hs-identifier hs-var">PgBang</span></a></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NonEmpty Id
-&gt; Kind -&gt; NonEmpty EquationInfo -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#matchBangs"><span class="hs-identifier hs-var">matchBangs</span></a></span><span>      </span><span class="annot"><span class="annottext">NonEmpty Id
</span><a href="#local-6989586621681143989"><span class="hs-identifier hs-var">vars</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143995"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NonEmpty (PatGroup, EquationInfo) -&gt; NonEmpty EquationInfo
forall (f :: * -&gt; *).
Functor f =&gt;
f (PatGroup, EquationInfo) -&gt; f EquationInfo
</span><a href="#local-6989586621681143969"><span class="hs-identifier hs-var">dropGroup</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (PatGroup, EquationInfo)
</span><a href="#local-6989586621681143961"><span class="hs-identifier hs-var">eqns</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-232"></span><span>            </span><span class="annot"><a href="GHC.HsToCore.Match.html#PgCo"><span class="hs-identifier hs-type">PgCo</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NonEmpty Id
-&gt; Kind -&gt; NonEmpty EquationInfo -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#matchCoercion"><span class="hs-identifier hs-var">matchCoercion</span></a></span><span>   </span><span class="annot"><span class="annottext">NonEmpty Id
</span><a href="#local-6989586621681143989"><span class="hs-identifier hs-var">vars</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143995"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NonEmpty (PatGroup, EquationInfo) -&gt; NonEmpty EquationInfo
forall (f :: * -&gt; *).
Functor f =&gt;
f (PatGroup, EquationInfo) -&gt; f EquationInfo
</span><a href="#local-6989586621681143969"><span class="hs-identifier hs-var">dropGroup</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (PatGroup, EquationInfo)
</span><a href="#local-6989586621681143961"><span class="hs-identifier hs-var">eqns</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-233"></span><span>            </span><span class="annot"><a href="GHC.HsToCore.Match.html#PgView"><span class="hs-identifier hs-type">PgView</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NonEmpty Id
-&gt; Kind -&gt; NonEmpty EquationInfo -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#matchView"><span class="hs-identifier hs-var">matchView</span></a></span><span>       </span><span class="annot"><span class="annottext">NonEmpty Id
</span><a href="#local-6989586621681143989"><span class="hs-identifier hs-var">vars</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143995"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NonEmpty (PatGroup, EquationInfo) -&gt; NonEmpty EquationInfo
forall (f :: * -&gt; *).
Functor f =&gt;
f (PatGroup, EquationInfo) -&gt; f EquationInfo
</span><a href="#local-6989586621681143969"><span class="hs-identifier hs-var">dropGroup</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (PatGroup, EquationInfo)
</span><a href="#local-6989586621681143961"><span class="hs-identifier hs-var">eqns</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-234"></span><span>            </span><span class="annot"><span class="annottext">PatGroup
</span><a href="GHC.HsToCore.Match.html#PgOverloadedList"><span class="hs-identifier hs-var">PgOverloadedList</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NonEmpty Id
-&gt; Kind -&gt; NonEmpty EquationInfo -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#matchOverloadedList"><span class="hs-identifier hs-var">matchOverloadedList</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty Id
</span><a href="#local-6989586621681143989"><span class="hs-identifier hs-var">vars</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143995"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NonEmpty (PatGroup, EquationInfo) -&gt; NonEmpty EquationInfo
forall (f :: * -&gt; *).
Functor f =&gt;
f (PatGroup, EquationInfo) -&gt; f EquationInfo
</span><a href="#local-6989586621681143969"><span class="hs-identifier hs-var">dropGroup</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (PatGroup, EquationInfo)
</span><a href="#local-6989586621681143961"><span class="hs-identifier hs-var">eqns</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-235"></span><span>      </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681143953"><span class="annot"><span class="annottext">eqns' :: [(PatGroup, EquationInfo)]
</span><a href="#local-6989586621681143953"><span class="hs-identifier hs-var hs-var">eqns'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NonEmpty (PatGroup, EquationInfo) -&gt; [(PatGroup, EquationInfo)]
forall a. NonEmpty a -&gt; [a]
</span><a href="../../base/src/Data.List.NonEmpty.html#toList"><span class="hs-identifier hs-var">NEL.toList</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (PatGroup, EquationInfo)
</span><a href="#local-6989586621681143961"><span class="hs-identifier hs-var">eqns</span></a></span><span>
</span><span id="line-236"></span><span>            </span><span id="local-6989586621681143957"><span class="annot"><span class="annottext">ne :: [a] -&gt; NonEmpty a
</span><a href="#local-6989586621681143957"><span class="hs-identifier hs-var hs-var">ne</span></a></span></span><span> </span><span id="local-6989586621681143927"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681143927"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; Maybe (NonEmpty a)
forall a. [a] -&gt; Maybe (NonEmpty a)
</span><a href="../../base/src/Data.List.NonEmpty.html#nonEmpty"><span class="hs-identifier hs-var">NEL.nonEmpty</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681143927"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-237"></span><span>              </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681143925"><span class="annot"><span class="annottext">NonEmpty a
</span><a href="#local-6989586621681143925"><span class="hs-identifier hs-var">nel</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NonEmpty a
</span><a href="#local-6989586621681143925"><span class="hs-identifier hs-var">nel</span></a></span><span>
</span><span id="line-238"></span><span>              </span><span class="annot"><span class="annottext">Maybe (NonEmpty a)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; NonEmpty a
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;match match_group&quot;</span></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; NonEmpty a) -&gt; SDoc -&gt; NonEmpty a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Empty result should be impossible since input was non-empty&quot;</span></span><span>
</span><span id="line-239"></span><span>
</span><span id="line-240"></span><span>    </span><span class="hs-comment">-- FIXME: we should also warn about view patterns that should be</span><span>
</span><span id="line-241"></span><span>    </span><span class="hs-comment">-- commoned up but are not</span><span>
</span><span id="line-242"></span><span>
</span><span id="line-243"></span><span>    </span><span class="hs-comment">-- print some stuff to see what's getting grouped</span><span>
</span><span id="line-244"></span><span>    </span><span class="hs-comment">-- use -dppr-debug to see the resolution of overloaded literals</span><span>
</span><span id="line-245"></span><span>    </span><span id="local-6989586621681143976"><span class="annot"><span class="annottext">debug :: [t (PatGroup, b)] -&gt; TcRnIf DsGblEnv DsLclEnv ()
</span><a href="#local-6989586621681143976"><span class="hs-identifier hs-var hs-var">debug</span></a></span></span><span> </span><span id="local-6989586621681143905"><span class="annot"><span class="annottext">[t (PatGroup, b)]
</span><a href="#local-6989586621681143905"><span class="hs-identifier hs-var">eqns</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-246"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681143904"><span class="annot"><span class="annottext">gs :: [[LHsExpr GhcTc]]
</span><a href="#local-6989586621681143904"><span class="hs-identifier hs-var hs-var">gs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(t (PatGroup, b) -&gt; [LHsExpr GhcTc])
-&gt; [t (PatGroup, b)] -&gt; [[LHsExpr GhcTc]]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681143903"><span class="annot"><span class="annottext">t (PatGroup, b)
</span><a href="#local-6989586621681143903"><span class="hs-identifier hs-var">group</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">((PatGroup, b) -&gt; [LHsExpr GhcTc] -&gt; [LHsExpr GhcTc])
-&gt; [LHsExpr GhcTc] -&gt; t (PatGroup, b) -&gt; [LHsExpr GhcTc]
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681143902"><span class="annot"><span class="annottext">PatGroup
</span><a href="#local-6989586621681143902"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">b
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681143901"><span class="annot"><span class="annottext">[LHsExpr GhcTc]
</span><a href="#local-6989586621681143901"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-247"></span><span>                                           </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">PatGroup
</span><a href="#local-6989586621681143902"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.html#PgView"><span class="hs-identifier hs-type">PgView</span></a></span><span> </span><span id="local-6989586621681143900"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143900"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="annot"><span class="annottext">Kind
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143900"><span class="hs-identifier hs-var">e</span></a></span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; [LHsExpr GhcTc] -&gt; [LHsExpr GhcTc]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[LHsExpr GhcTc]
</span><a href="#local-6989586621681143901"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-248"></span><span>                                                     </span><span class="annot"><span class="annottext">PatGroup
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[LHsExpr GhcTc]
</span><a href="#local-6989586621681143901"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">t (PatGroup, b)
</span><a href="#local-6989586621681143903"><span class="hs-identifier hs-var">group</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[t (PatGroup, b)]
</span><a href="#local-6989586621681143905"><span class="hs-identifier hs-var">eqns</span></a></span><span>
</span><span id="line-249"></span><span>            </span><span id="local-6989586621681143897"><span class="annot"><span class="annottext">maybeWarn :: [SDoc] -&gt; TcRnIf DsGblEnv DsLclEnv ()
</span><a href="#local-6989586621681143897"><span class="hs-identifier hs-var hs-var">maybeWarn</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; TcRnIf DsGblEnv DsLclEnv ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-250"></span><span>            </span><span class="annot"><a href="#local-6989586621681143897"><span class="hs-identifier hs-var">maybeWarn</span></a></span><span> </span><span id="local-6989586621681143896"><span class="annot"><span class="annottext">[SDoc]
</span><a href="#local-6989586621681143896"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">WarnReason -&gt; SDoc -&gt; TcRnIf DsGblEnv DsLclEnv ()
</span><a href="GHC.HsToCore.Monad.html#warnDs"><span class="hs-identifier hs-var">warnDs</span></a></span><span> </span><span class="annot"><span class="annottext">WarnReason
</span><a href="GHC.Driver.Flags.html#NoReason"><span class="hs-identifier hs-var">NoReason</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc]
</span><a href="#local-6989586621681143896"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-251"></span><span>        </span><span class="hs-keyword">in</span><span>
</span><span id="line-252"></span><span>          </span><span class="annot"><span class="annottext">[SDoc] -&gt; TcRnIf DsGblEnv DsLclEnv ()
</span><a href="#local-6989586621681143897"><span class="hs-identifier hs-var">maybeWarn</span></a></span><span> </span><span class="annot"><span class="annottext">([SDoc] -&gt; TcRnIf DsGblEnv DsLclEnv ())
-&gt; [SDoc] -&gt; TcRnIf DsGblEnv DsLclEnv ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">([LHsExpr GhcTc] -&gt; SDoc) -&gt; [[LHsExpr GhcTc]] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681143892"><span class="annot"><span class="annottext">[LHsExpr GhcTc]
</span><a href="#local-6989586621681143892"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Putting these view expressions into the same case:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LHsExpr GhcTc] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsExpr GhcTc]
</span><a href="#local-6989586621681143892"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-253"></span><span>                       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">([LHsExpr GhcTc] -&gt; Bool) -&gt; [[LHsExpr GhcTc]] -&gt; [[LHsExpr GhcTc]]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool)
-&gt; ([LHsExpr GhcTc] -&gt; Bool) -&gt; [LHsExpr GhcTc] -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsExpr GhcTc] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[[LHsExpr GhcTc]]
</span><a href="#local-6989586621681143904"><span class="hs-identifier hs-var">gs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-254"></span><span>
</span><span id="line-255"></span><span class="annot"><a href="GHC.HsToCore.Match.html#matchEmpty"><span class="hs-identifier hs-type">matchEmpty</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.html#MatchId"><span class="hs-identifier hs-type">MatchId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Monad.html#MatchResult"><span class="hs-identifier hs-type">MatchResult</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-256"></span><span class="hs-comment">-- See Note [Empty case expressions]</span><span>
</span><span id="line-257"></span><span id="matchEmpty"><span class="annot"><span class="annottext">matchEmpty :: Id -&gt; Kind -&gt; DsM (NonEmpty (MatchResult CoreExpr))
</span><a href="GHC.HsToCore.Match.html#matchEmpty"><span class="hs-identifier hs-var hs-var">matchEmpty</span></a></span></span><span> </span><span id="local-6989586621681143890"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143890"><span class="hs-identifier hs-var">var</span></a></span></span><span> </span><span id="local-6989586621681143889"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143889"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span>
</span><span id="line-258"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NonEmpty (MatchResult CoreExpr)
-&gt; DsM (NonEmpty (MatchResult CoreExpr))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">(CoreExpr -&gt; DsM CoreExpr) -&gt; MatchResult CoreExpr
forall a. (CoreExpr -&gt; DsM a) -&gt; MatchResult a
</span><a href="GHC.HsToCore.Monad.html#MR_Fallible"><span class="hs-identifier hs-var">MR_Fallible</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
</span><a href="#local-6989586621681143887"><span class="hs-identifier hs-var">mk_seq</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-259"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-260"></span><span>    </span><span id="local-6989586621681143887"><span class="annot"><span class="annottext">mk_seq :: CoreExpr -&gt; DsM CoreExpr
</span><a href="#local-6989586621681143887"><span class="hs-identifier hs-var hs-var">mk_seq</span></a></span></span><span> </span><span id="local-6989586621681143886"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681143886"><span class="hs-identifier hs-var">fail</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; DsM CoreExpr) -&gt; CoreExpr -&gt; DsM CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Scaled Kind -&gt; Kind -&gt; [CoreAlt] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkWildCase"><span class="hs-identifier hs-var">mkWildCase</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143890"><span class="hs-identifier hs-var">var</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Scaled Kind
</span><a href="GHC.Types.Id.html#idScaledType"><span class="hs-identifier hs-var">idScaledType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143890"><span class="hs-identifier hs-var">var</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143889"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-261"></span><span>                                      </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">AltCon
</span><a href="GHC.Core.html#DEFAULT"><span class="hs-identifier hs-var">DEFAULT</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681143886"><span class="hs-identifier hs-var">fail</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-262"></span><span>
</span><span id="line-263"></span><span class="annot"><a href="GHC.HsToCore.Match.html#matchVariables"><span class="hs-identifier hs-type">matchVariables</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.html#MatchId"><span class="hs-identifier hs-type">MatchId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Monad.html#MatchResult"><span class="hs-identifier hs-type">MatchResult</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-264"></span><span class="hs-comment">-- Real true variables, just like in matchVar, SLPJ p 94</span><span>
</span><span id="line-265"></span><span class="hs-comment">-- No binding to do: they'll all be wildcards by now (done in tidy)</span><span>
</span><span id="line-266"></span><span id="matchVariables"><span class="annot"><span class="annottext">matchVariables :: NonEmpty Id
-&gt; Kind -&gt; NonEmpty EquationInfo -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#matchVariables"><span class="hs-identifier hs-var hs-var">matchVariables</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621681143881"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681143881"><span class="hs-identifier hs-var">vars</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681143880"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143880"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681143879"><span class="annot"><span class="annottext">NonEmpty EquationInfo
</span><a href="#local-6989586621681143879"><span class="hs-identifier hs-var">eqns</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Kind -&gt; [EquationInfo] -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#match"><span class="hs-identifier hs-var">match</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681143881"><span class="hs-identifier hs-var">vars</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143880"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">([EquationInfo] -&gt; DsM (MatchResult CoreExpr))
-&gt; [EquationInfo] -&gt; DsM (MatchResult CoreExpr)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty EquationInfo -&gt; [EquationInfo]
forall a. NonEmpty a -&gt; [a]
</span><a href="../../base/src/Data.List.NonEmpty.html#toList"><span class="hs-identifier hs-var">NEL.toList</span></a></span><span> </span><span class="annot"><span class="annottext">(NonEmpty EquationInfo -&gt; [EquationInfo])
-&gt; NonEmpty EquationInfo -&gt; [EquationInfo]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty EquationInfo -&gt; NonEmpty EquationInfo
forall (f :: * -&gt; *). Functor f =&gt; f EquationInfo -&gt; f EquationInfo
</span><a href="GHC.HsToCore.Utils.html#shiftEqns"><span class="hs-identifier hs-var">shiftEqns</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty EquationInfo
</span><a href="#local-6989586621681143879"><span class="hs-identifier hs-var">eqns</span></a></span><span>
</span><span id="line-267"></span><span>
</span><span id="line-268"></span><span class="annot"><a href="GHC.HsToCore.Match.html#matchBangs"><span class="hs-identifier hs-type">matchBangs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.html#MatchId"><span class="hs-identifier hs-type">MatchId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Monad.html#MatchResult"><span class="hs-identifier hs-type">MatchResult</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-269"></span><span id="matchBangs"><span class="annot"><span class="annottext">matchBangs :: NonEmpty Id
-&gt; Kind -&gt; NonEmpty EquationInfo -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#matchBangs"><span class="hs-identifier hs-var hs-var">matchBangs</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681143877"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143877"><span class="hs-identifier hs-var">var</span></a></span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621681143876"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681143876"><span class="hs-identifier hs-var">vars</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681143875"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143875"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681143874"><span class="annot"><span class="annottext">NonEmpty EquationInfo
</span><a href="#local-6989586621681143874"><span class="hs-identifier hs-var">eqns</span></a></span></span><span>
</span><span id="line-270"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681143873"><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681143873"><span class="hs-identifier hs-var">match_result</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Kind -&gt; [EquationInfo] -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#match"><span class="hs-identifier hs-var">match</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143877"><span class="hs-identifier hs-var">var</span></a></span><span class="annot"><span class="annottext">Id -&gt; [Id] -&gt; [Id]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681143876"><span class="hs-identifier hs-var">vars</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143875"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">([EquationInfo] -&gt; DsM (MatchResult CoreExpr))
-&gt; [EquationInfo] -&gt; DsM (MatchResult CoreExpr)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty EquationInfo -&gt; [EquationInfo]
forall a. NonEmpty a -&gt; [a]
</span><a href="../../base/src/Data.List.NonEmpty.html#toList"><span class="hs-identifier hs-var">NEL.toList</span></a></span><span> </span><span class="annot"><span class="annottext">(NonEmpty EquationInfo -&gt; [EquationInfo])
-&gt; NonEmpty EquationInfo -&gt; [EquationInfo]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-271"></span><span>            </span><span class="annot"><span class="annottext">(Pat GhcTc -&gt; Pat GhcTc) -&gt; EquationInfo -&gt; EquationInfo
</span><a href="GHC.HsToCore.Match.html#decomposeFirstPat"><span class="hs-identifier hs-var">decomposeFirstPat</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc -&gt; Pat GhcTc
</span><a href="GHC.HsToCore.Match.html#getBangPat"><span class="hs-identifier hs-var">getBangPat</span></a></span><span> </span><span class="annot"><span class="annottext">(EquationInfo -&gt; EquationInfo)
-&gt; NonEmpty EquationInfo -&gt; NonEmpty EquationInfo
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty EquationInfo
</span><a href="#local-6989586621681143874"><span class="hs-identifier hs-var">eqns</span></a></span><span>
</span><span id="line-272"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr -&gt; DsM (MatchResult CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Kind -&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr
</span><a href="GHC.HsToCore.Utils.html#mkEvalMatchResult"><span class="hs-identifier hs-var">mkEvalMatchResult</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143877"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143875"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681143873"><span class="hs-identifier hs-var">match_result</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-273"></span><span>
</span><span id="line-274"></span><span class="annot"><a href="GHC.HsToCore.Match.html#matchCoercion"><span class="hs-identifier hs-type">matchCoercion</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.html#MatchId"><span class="hs-identifier hs-type">MatchId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Monad.html#MatchResult"><span class="hs-identifier hs-type">MatchResult</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-275"></span><span class="hs-comment">-- Apply the coercion to the match variable and then match that</span><span>
</span><span id="line-276"></span><span id="matchCoercion"><span class="annot"><span class="annottext">matchCoercion :: NonEmpty Id
-&gt; Kind -&gt; NonEmpty EquationInfo -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#matchCoercion"><span class="hs-identifier hs-var hs-var">matchCoercion</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681143869"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143869"><span class="hs-identifier hs-var">var</span></a></span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621681143868"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681143868"><span class="hs-identifier hs-var">vars</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681143867"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143867"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681143866"><span class="annot"><span class="annottext">eqns :: NonEmpty EquationInfo
</span><a href="#local-6989586621681143866"><span class="hs-identifier hs-var">eqns</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span id="local-6989586621681143865"><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681143865"><span class="hs-identifier hs-var">eqn1</span></a></span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span class="annot"><span class="annottext">[EquationInfo]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-277"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#XPat"><span class="hs-identifier hs-type">XPat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#CoPat"><span class="hs-identifier hs-type">CoPat</span></a></span><span> </span><span id="local-6989586621681143862"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143862"><span class="hs-identifier hs-var">co</span></a></span></span><span> </span><span id="local-6989586621681143861"><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143861"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span class="annot"><span class="annottext">Kind
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">EquationInfo -&gt; Pat GhcTc
</span><a href="GHC.HsToCore.Utils.html#firstPat"><span class="hs-identifier hs-var">firstPat</span></a></span><span> </span><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681143865"><span class="hs-identifier hs-var">eqn1</span></a></span><span>
</span><span id="line-278"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681143859"><span class="annot"><span class="annottext">pat_ty' :: Kind
</span><a href="#local-6989586621681143859"><span class="hs-identifier hs-var hs-var">pat_ty'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Pat GhcTc -&gt; Kind
</span><a href="GHC.Tc.Utils.Zonk.html#hsPatType"><span class="hs-identifier hs-var">hsPatType</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143861"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-279"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681143857"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143857"><span class="hs-identifier hs-var">var'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Kind -&gt; Kind -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newUniqueId"><span class="hs-identifier hs-var">newUniqueId</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143869"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Id.html#idMult"><span class="hs-identifier hs-var">idMult</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143869"><span class="hs-identifier hs-var">var</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143859"><span class="hs-identifier hs-var">pat_ty'</span></a></span><span>
</span><span id="line-280"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681143854"><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681143854"><span class="hs-identifier hs-var">match_result</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Kind -&gt; [EquationInfo] -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#match"><span class="hs-identifier hs-var">match</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143857"><span class="hs-identifier hs-var">var'</span></a></span><span class="annot"><span class="annottext">Id -&gt; [Id] -&gt; [Id]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681143868"><span class="hs-identifier hs-var">vars</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143867"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">([EquationInfo] -&gt; DsM (MatchResult CoreExpr))
-&gt; [EquationInfo] -&gt; DsM (MatchResult CoreExpr)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty EquationInfo -&gt; [EquationInfo]
forall a. NonEmpty a -&gt; [a]
</span><a href="../../base/src/Data.List.NonEmpty.html#toList"><span class="hs-identifier hs-var">NEL.toList</span></a></span><span> </span><span class="annot"><span class="annottext">(NonEmpty EquationInfo -&gt; [EquationInfo])
-&gt; NonEmpty EquationInfo -&gt; [EquationInfo]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-281"></span><span>            </span><span class="annot"><span class="annottext">(Pat GhcTc -&gt; Pat GhcTc) -&gt; EquationInfo -&gt; EquationInfo
</span><a href="GHC.HsToCore.Match.html#decomposeFirstPat"><span class="hs-identifier hs-var">decomposeFirstPat</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc -&gt; Pat GhcTc
</span><a href="GHC.HsToCore.Match.html#getCoPat"><span class="hs-identifier hs-var">getCoPat</span></a></span><span> </span><span class="annot"><span class="annottext">(EquationInfo -&gt; EquationInfo)
-&gt; NonEmpty EquationInfo -&gt; NonEmpty EquationInfo
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty EquationInfo
</span><a href="#local-6989586621681143866"><span class="hs-identifier hs-var">eqns</span></a></span><span>
</span><span id="line-282"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681143852"><span class="annot"><span class="annottext">DsWrapper
</span><a href="#local-6989586621681143852"><span class="hs-identifier hs-var">core_wrap</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsWrapper -&gt; DsM DsWrapper
</span><a href="GHC.HsToCore.Binds.html#dsHsWrapper"><span class="hs-identifier hs-var">dsHsWrapper</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143862"><span class="hs-identifier hs-var">co</span></a></span><span>
</span><span id="line-283"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681143850"><span class="annot"><span class="annottext">bind :: Bind Id
</span><a href="#local-6989586621681143850"><span class="hs-identifier hs-var hs-var">bind</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; Bind Id
forall b. b -&gt; Expr b -&gt; Bind b
</span><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-var">NonRec</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143857"><span class="hs-identifier hs-var">var'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsWrapper
</span><a href="#local-6989586621681143852"><span class="hs-identifier hs-var">core_wrap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143869"><span class="hs-identifier hs-var">var</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-284"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr -&gt; DsM (MatchResult CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bind Id -&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr
</span><a href="GHC.HsToCore.Utils.html#mkCoLetMatchResult"><span class="hs-identifier hs-var">mkCoLetMatchResult</span></a></span><span> </span><span class="annot"><span class="annottext">Bind Id
</span><a href="#local-6989586621681143850"><span class="hs-identifier hs-var">bind</span></a></span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681143854"><span class="hs-identifier hs-var">match_result</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-285"></span><span>
</span><span id="line-286"></span><span class="annot"><a href="GHC.HsToCore.Match.html#matchView"><span class="hs-identifier hs-type">matchView</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.html#MatchId"><span class="hs-identifier hs-type">MatchId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Monad.html#MatchResult"><span class="hs-identifier hs-type">MatchResult</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-287"></span><span class="hs-comment">-- Apply the view function to the match variable and then match that</span><span>
</span><span id="line-288"></span><span id="matchView"><span class="annot"><span class="annottext">matchView :: NonEmpty Id
-&gt; Kind -&gt; NonEmpty EquationInfo -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#matchView"><span class="hs-identifier hs-var hs-var">matchView</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681143847"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143847"><span class="hs-identifier hs-var">var</span></a></span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621681143846"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681143846"><span class="hs-identifier hs-var">vars</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681143845"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143845"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681143844"><span class="annot"><span class="annottext">eqns :: NonEmpty EquationInfo
</span><a href="#local-6989586621681143844"><span class="hs-identifier hs-var">eqns</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span id="local-6989586621681143843"><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681143843"><span class="hs-identifier hs-var">eqn1</span></a></span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span class="annot"><span class="annottext">[EquationInfo]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-289"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-comment">-- we could pass in the expr from the PgView,</span><span>
</span><span id="line-290"></span><span>         </span><span class="hs-comment">-- but this needs to extract the pat anyway</span><span>
</span><span id="line-291"></span><span>         </span><span class="hs-comment">-- to figure out the type of the fresh variable</span><span>
</span><span id="line-292"></span><span>         </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#ViewPat"><span class="hs-identifier hs-type">ViewPat</span></a></span><span> </span><span class="annot"><span class="annottext">XViewPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143841"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143841"><span class="hs-identifier hs-var">viewExpr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143839"><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143839"><span class="hs-identifier hs-var">pat</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">EquationInfo -&gt; Pat GhcTc
</span><a href="GHC.HsToCore.Utils.html#firstPat"><span class="hs-identifier hs-var">firstPat</span></a></span><span> </span><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681143843"><span class="hs-identifier hs-var">eqn1</span></a></span><span>
</span><span id="line-293"></span><span>         </span><span class="hs-comment">-- do the rest of the compilation</span><span>
</span><span id="line-294"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681143838"><span class="annot"><span class="annottext">pat_ty' :: Kind
</span><a href="#local-6989586621681143838"><span class="hs-identifier hs-var hs-var">pat_ty'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Pat GhcTc -&gt; Kind
</span><a href="GHC.Tc.Utils.Zonk.html#hsPatType"><span class="hs-identifier hs-var">hsPatType</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143839"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-295"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681143837"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143837"><span class="hs-identifier hs-var">var'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Kind -&gt; Kind -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newUniqueId"><span class="hs-identifier hs-var">newUniqueId</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143847"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Id.html#idMult"><span class="hs-identifier hs-var">idMult</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143847"><span class="hs-identifier hs-var">var</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143838"><span class="hs-identifier hs-var">pat_ty'</span></a></span><span>
</span><span id="line-296"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681143836"><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681143836"><span class="hs-identifier hs-var">match_result</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Kind -&gt; [EquationInfo] -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#match"><span class="hs-identifier hs-var">match</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143837"><span class="hs-identifier hs-var">var'</span></a></span><span class="annot"><span class="annottext">Id -&gt; [Id] -&gt; [Id]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681143846"><span class="hs-identifier hs-var">vars</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143845"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">([EquationInfo] -&gt; DsM (MatchResult CoreExpr))
-&gt; [EquationInfo] -&gt; DsM (MatchResult CoreExpr)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty EquationInfo -&gt; [EquationInfo]
forall a. NonEmpty a -&gt; [a]
</span><a href="../../base/src/Data.List.NonEmpty.html#toList"><span class="hs-identifier hs-var">NEL.toList</span></a></span><span> </span><span class="annot"><span class="annottext">(NonEmpty EquationInfo -&gt; [EquationInfo])
-&gt; NonEmpty EquationInfo -&gt; [EquationInfo]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-297"></span><span>            </span><span class="annot"><span class="annottext">(Pat GhcTc -&gt; Pat GhcTc) -&gt; EquationInfo -&gt; EquationInfo
</span><a href="GHC.HsToCore.Match.html#decomposeFirstPat"><span class="hs-identifier hs-var">decomposeFirstPat</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc -&gt; Pat GhcTc
</span><a href="GHC.HsToCore.Match.html#getViewPat"><span class="hs-identifier hs-var">getViewPat</span></a></span><span> </span><span class="annot"><span class="annottext">(EquationInfo -&gt; EquationInfo)
-&gt; NonEmpty EquationInfo -&gt; NonEmpty EquationInfo
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty EquationInfo
</span><a href="#local-6989586621681143844"><span class="hs-identifier hs-var">eqns</span></a></span><span>
</span><span id="line-298"></span><span>         </span><span class="hs-comment">-- compile the view expressions</span><span>
</span><span id="line-299"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681143834"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681143834"><span class="hs-identifier hs-var">viewExpr'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier hs-var">dsLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143841"><span class="hs-identifier hs-var">viewExpr</span></a></span><span>
</span><span id="line-300"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr -&gt; DsM (MatchResult CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr
</span><a href="GHC.HsToCore.Utils.html#mkViewMatchResult"><span class="hs-identifier hs-var">mkViewMatchResult</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143837"><span class="hs-identifier hs-var">var'</span></a></span><span>
</span><span id="line-301"></span><span>                    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; CoreExpr -&gt; DsWrapper
</span><a href="GHC.HsToCore.Utils.html#mkCoreAppDs"><span class="hs-identifier hs-var">mkCoreAppDs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;matchView&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681143834"><span class="hs-identifier hs-var">viewExpr'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143847"><span class="hs-identifier hs-var">var</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-302"></span><span>                    </span><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681143836"><span class="hs-identifier hs-var">match_result</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-303"></span><span>
</span><span id="line-304"></span><span class="annot"><a href="GHC.HsToCore.Match.html#matchOverloadedList"><span class="hs-identifier hs-type">matchOverloadedList</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.html#MatchId"><span class="hs-identifier hs-type">MatchId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Monad.html#MatchResult"><span class="hs-identifier hs-type">MatchResult</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-305"></span><span id="matchOverloadedList"><span class="annot"><span class="annottext">matchOverloadedList :: NonEmpty Id
-&gt; Kind -&gt; NonEmpty EquationInfo -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#matchOverloadedList"><span class="hs-identifier hs-var hs-var">matchOverloadedList</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681143831"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143831"><span class="hs-identifier hs-var">var</span></a></span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621681143830"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681143830"><span class="hs-identifier hs-var">vars</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681143829"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143829"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681143828"><span class="annot"><span class="annottext">eqns :: NonEmpty EquationInfo
</span><a href="#local-6989586621681143828"><span class="hs-identifier hs-var">eqns</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span id="local-6989586621681143827"><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681143827"><span class="hs-identifier hs-var">eqn1</span></a></span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span class="annot"><span class="annottext">[EquationInfo]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-306"></span><span class="hs-comment">-- Since overloaded list patterns are treated as view patterns,</span><span>
</span><span id="line-307"></span><span class="hs-comment">-- the code is roughly the same as for matchView</span><span>
</span><span id="line-308"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#ListPat"><span class="hs-identifier hs-type">ListPat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#ListPatTc"><span class="hs-identifier hs-type">ListPatTc</span></a></span><span> </span><span id="local-6989586621681143824"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143824"><span class="hs-identifier hs-var">elt_ty</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Kind
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621681143823"><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681143823"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LPat GhcTc]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">EquationInfo -&gt; Pat GhcTc
</span><a href="GHC.HsToCore.Utils.html#firstPat"><span class="hs-identifier hs-var">firstPat</span></a></span><span> </span><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681143827"><span class="hs-identifier hs-var">eqn1</span></a></span><span>
</span><span id="line-309"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681143822"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143822"><span class="hs-identifier hs-var">var'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Kind -&gt; Kind -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newUniqueId"><span class="hs-identifier hs-var">newUniqueId</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143831"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Id.html#idMult"><span class="hs-identifier hs-var">idMult</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143831"><span class="hs-identifier hs-var">var</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Kind -&gt; Kind
</span><a href="GHC.Builtin.Types.html#mkListTy"><span class="hs-identifier hs-var">mkListTy</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143824"><span class="hs-identifier hs-var">elt_ty</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- we construct the overall type by hand</span><span>
</span><span id="line-310"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681143820"><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681143820"><span class="hs-identifier hs-var">match_result</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Kind -&gt; [EquationInfo] -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#match"><span class="hs-identifier hs-var">match</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143822"><span class="hs-identifier hs-var">var'</span></a></span><span class="annot"><span class="annottext">Id -&gt; [Id] -&gt; [Id]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681143830"><span class="hs-identifier hs-var">vars</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143829"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">([EquationInfo] -&gt; DsM (MatchResult CoreExpr))
-&gt; [EquationInfo] -&gt; DsM (MatchResult CoreExpr)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty EquationInfo -&gt; [EquationInfo]
forall a. NonEmpty a -&gt; [a]
</span><a href="../../base/src/Data.List.NonEmpty.html#toList"><span class="hs-identifier hs-var">NEL.toList</span></a></span><span> </span><span class="annot"><span class="annottext">(NonEmpty EquationInfo -&gt; [EquationInfo])
-&gt; NonEmpty EquationInfo -&gt; [EquationInfo]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-311"></span><span>           </span><span class="annot"><span class="annottext">(Pat GhcTc -&gt; Pat GhcTc) -&gt; EquationInfo -&gt; EquationInfo
</span><a href="GHC.HsToCore.Match.html#decomposeFirstPat"><span class="hs-identifier hs-var">decomposeFirstPat</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc -&gt; Pat GhcTc
</span><a href="GHC.HsToCore.Match.html#getOLPat"><span class="hs-identifier hs-var">getOLPat</span></a></span><span> </span><span class="annot"><span class="annottext">(EquationInfo -&gt; EquationInfo)
-&gt; NonEmpty EquationInfo -&gt; NonEmpty EquationInfo
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty EquationInfo
</span><a href="#local-6989586621681143828"><span class="hs-identifier hs-var">eqns</span></a></span><span> </span><span class="hs-comment">-- getOLPat builds the pattern inside as a non-overloaded version of the overloaded list pattern</span><span>
</span><span id="line-312"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681143818"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681143818"><span class="hs-identifier hs-var">e'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc -&gt; [CoreExpr] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsSyntaxExpr"><span class="hs-identifier hs-var">dsSyntaxExpr</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681143823"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143831"><span class="hs-identifier hs-var">var</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-313"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr -&gt; DsM (MatchResult CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr
</span><a href="GHC.HsToCore.Utils.html#mkViewMatchResult"><span class="hs-identifier hs-var">mkViewMatchResult</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143822"><span class="hs-identifier hs-var">var'</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681143818"><span class="hs-identifier hs-var">e'</span></a></span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681143820"><span class="hs-identifier hs-var">match_result</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-314"></span><span>       </span><span class="hs-special">}</span><span>
</span><span id="line-315"></span><span>
</span><span id="line-316"></span><span class="hs-comment">-- decompose the first pattern and leave the rest alone</span><span>
</span><span id="line-317"></span><span class="annot"><a href="GHC.HsToCore.Match.html#decomposeFirstPat"><span class="hs-identifier hs-type">decomposeFirstPat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#Pat"><span class="hs-identifier hs-type">Pat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#Pat"><span class="hs-identifier hs-type">Pat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span>
</span><span id="line-318"></span><span id="decomposeFirstPat"><span class="annot"><span class="annottext">decomposeFirstPat :: (Pat GhcTc -&gt; Pat GhcTc) -&gt; EquationInfo -&gt; EquationInfo
</span><a href="GHC.HsToCore.Match.html#decomposeFirstPat"><span class="hs-identifier hs-var hs-var">decomposeFirstPat</span></a></span></span><span> </span><span id="local-6989586621681143817"><span class="annot"><span class="annottext">Pat GhcTc -&gt; Pat GhcTc
</span><a href="#local-6989586621681143817"><span class="hs-identifier hs-var">extractpat</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681143816"><span class="annot"><span class="annottext">eqn :: EquationInfo
</span><a href="#local-6989586621681143816"><span class="hs-identifier hs-var">eqn</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Monad.html#EqnInfo"><span class="hs-identifier hs-type">EqnInfo</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">eqn_pats :: EquationInfo -&gt; [Pat GhcTc]
</span><a href="GHC.HsToCore.Monad.html#eqn_pats"><span class="hs-identifier hs-var">eqn_pats</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681143814"><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143814"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681143813"><span class="annot"><span class="annottext">[Pat GhcTc]
</span><a href="#local-6989586621681143813"><span class="hs-identifier hs-var">pats</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-319"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681143816"><span class="hs-identifier hs-var">eqn</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">eqn_pats :: [Pat GhcTc]
</span><a href="GHC.HsToCore.Monad.html#eqn_pats"><span class="hs-identifier hs-var">eqn_pats</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Pat GhcTc -&gt; Pat GhcTc
</span><a href="#local-6989586621681143817"><span class="hs-identifier hs-var">extractpat</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143814"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc -&gt; [Pat GhcTc] -&gt; [Pat GhcTc]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[Pat GhcTc]
</span><a href="#local-6989586621681143813"><span class="hs-identifier hs-var">pats</span></a></span><span class="hs-special">}</span><span>
</span><span id="line-320"></span><span class="annot"><a href="GHC.HsToCore.Match.html#decomposeFirstPat"><span class="hs-identifier hs-var">decomposeFirstPat</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc -&gt; Pat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">EquationInfo
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; EquationInfo
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;decomposeFirstPat&quot;</span></span><span>
</span><span id="line-321"></span><span>
</span><span id="line-322"></span><span class="annot"><a href="GHC.HsToCore.Match.html#getCoPat"><span class="hs-identifier hs-type">getCoPat</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.html#getBangPat"><span class="hs-identifier hs-type">getBangPat</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.html#getViewPat"><span class="hs-identifier hs-type">getViewPat</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.html#getOLPat"><span class="hs-identifier hs-type">getOLPat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#Pat"><span class="hs-identifier hs-type">Pat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#Pat"><span class="hs-identifier hs-type">Pat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>
</span><span id="line-323"></span><span id="getCoPat"><span class="annot"><span class="annottext">getCoPat :: Pat GhcTc -&gt; Pat GhcTc
</span><a href="GHC.HsToCore.Match.html#getCoPat"><span class="hs-identifier hs-var hs-var">getCoPat</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#XPat"><span class="hs-identifier hs-type">XPat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#CoPat"><span class="hs-identifier hs-type">CoPat</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143811"><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143811"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span class="annot"><span class="annottext">Kind
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143811"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-324"></span><span class="annot"><a href="GHC.HsToCore.Match.html#getCoPat"><span class="hs-identifier hs-var">getCoPat</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><span class="hs-identifier">_</span></span><span>                   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Pat GhcTc
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;getCoPat&quot;</span></span><span>
</span><span id="line-325"></span><span id="getBangPat"><span class="annot"><span class="annottext">getBangPat :: Pat GhcTc -&gt; Pat GhcTc
</span><a href="GHC.HsToCore.Match.html#getBangPat"><span class="hs-identifier hs-var hs-var">getBangPat</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#BangPat"><span class="hs-identifier hs-type">BangPat</span></a></span><span> </span><span class="annot"><span class="annottext">XBangPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143809"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681143809"><span class="hs-identifier hs-var">pat</span></a></span></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc) -&gt; Pat GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681143809"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-326"></span><span class="annot"><a href="GHC.HsToCore.Match.html#getBangPat"><span class="hs-identifier hs-var">getBangPat</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><span class="hs-identifier">_</span></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Pat GhcTc
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;getBangPat&quot;</span></span><span>
</span><span id="line-327"></span><span id="getViewPat"><span class="annot"><span class="annottext">getViewPat :: Pat GhcTc -&gt; Pat GhcTc
</span><a href="GHC.HsToCore.Match.html#getViewPat"><span class="hs-identifier hs-var hs-var">getViewPat</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#ViewPat"><span class="hs-identifier hs-type">ViewPat</span></a></span><span> </span><span class="annot"><span class="annottext">XViewPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143807"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681143807"><span class="hs-identifier hs-var">pat</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc) -&gt; Pat GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681143807"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-328"></span><span class="annot"><a href="GHC.HsToCore.Match.html#getViewPat"><span class="hs-identifier hs-var">getViewPat</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><span class="hs-identifier">_</span></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Pat GhcTc
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;getViewPat&quot;</span></span><span>
</span><span id="line-329"></span><span id="getOLPat"><span class="annot"><span class="annottext">getOLPat :: Pat GhcTc -&gt; Pat GhcTc
</span><a href="GHC.HsToCore.Match.html#getOLPat"><span class="hs-identifier hs-var hs-var">getOLPat</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#ListPat"><span class="hs-identifier hs-type">ListPat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#ListPatTc"><span class="hs-identifier hs-type">ListPatTc</span></a></span><span> </span><span id="local-6989586621681143806"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143806"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(Kind, SyntaxExpr GhcTc)
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681143805"><span class="annot"><span class="annottext">[LPat GhcTc]
</span><a href="#local-6989586621681143805"><span class="hs-identifier hs-var">pats</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-330"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">XListPat GhcTc -&gt; [LPat GhcTc] -&gt; Pat GhcTc
forall p. XListPat p -&gt; [LPat p] -&gt; Pat p
</span><a href="GHC.Hs.Pat.html#ListPat"><span class="hs-identifier hs-var">ListPat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Kind -&gt; Maybe (Kind, SyntaxExpr GhcTc) -&gt; ListPatTc
</span><a href="GHC.Hs.Pat.html#ListPatTc"><span class="hs-identifier hs-var">ListPatTc</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143806"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (Kind, SyntaxExpr GhcTc)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span>  </span><span class="annot"><span class="annottext">[LPat GhcTc]
</span><a href="#local-6989586621681143805"><span class="hs-identifier hs-var">pats</span></a></span><span>
</span><span id="line-331"></span><span class="annot"><a href="GHC.HsToCore.Match.html#getOLPat"><span class="hs-identifier hs-var">getOLPat</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><span class="hs-identifier">_</span></span><span>                   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Pat GhcTc
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;getOLPat&quot;</span></span><span>
</span><span id="line-332"></span><span>
</span><span id="line-333"></span><span class="hs-comment">{-
Note [Empty case alternatives]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The list of EquationInfo can be empty, arising from
    case x of {}   or    \case {}
In that situation we desugar to
    case x of { _ -&gt; error &quot;pattern match failure&quot; }
The *desugarer* isn't certain whether there really should be no
alternatives, so it adds a default case, as it always does.  A later
pass may remove it if it's inaccessible.  (See also Note [Empty case
alternatives] in GHC.Core.)

We do *not* desugar simply to
   error &quot;empty case&quot;
or some such, because 'x' might be bound to (error &quot;hello&quot;), in which
case we want to see that &quot;hello&quot; exception, not (error &quot;empty case&quot;).
See also Note [Case elimination: lifted case] in GHC.Core.Opt.Simplify.


************************************************************************
*                                                                      *
                Tidying patterns
*                                                                      *
************************************************************************

Tidy up the leftmost pattern in an @EquationInfo@, given the variable @v@
which will be scrutinised.

This makes desugaring the pattern match simpler by transforming some of
the patterns to simpler forms. (Tuples to Constructor Patterns)

Among other things in the resulting Pattern:
* Variables and irrefutable(lazy) patterns are replaced by Wildcards
* As patterns are replaced by the patterns they wrap.

The bindings created by the above patterns are put into the returned wrapper
instead.

This means a definition of the form:
  f x = rhs
when called with v get's desugared to the equivalent of:
  let x = v
  in
  f _ = rhs

The same principle holds for as patterns (@) and
irrefutable/lazy patterns (~).
In the case of irrefutable patterns the irrefutable pattern is pushed into
the binding.

Pattern Constructors which only represent syntactic sugar are converted into
their desugared representation.
This usually means converting them to Constructor patterns but for some
depends on enabled extensions. (Eg OverloadedLists)

GHC also tries to convert overloaded Literals into regular ones.

The result of this tidying is that the column of patterns will include
only these which can be assigned a PatternGroup (see patGroup).

-}</span><span>
</span><span id="line-394"></span><span>
</span><span id="line-395"></span><span class="annot"><a href="GHC.HsToCore.Match.html#tidyEqnInfo"><span class="hs-identifier hs-type">tidyEqnInfo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span>
</span><span id="line-396"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Monad.html#DsWrapper"><span class="hs-identifier hs-type">DsWrapper</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-397"></span><span>        </span><span class="hs-comment">-- DsM'd because of internal call to dsLHsBinds</span><span>
</span><span id="line-398"></span><span>        </span><span class="hs-comment">--      and mkSelectorBinds.</span><span>
</span><span id="line-399"></span><span>        </span><span class="hs-comment">-- &quot;tidy1&quot; does the interesting stuff, looking at</span><span>
</span><span id="line-400"></span><span>        </span><span class="hs-comment">-- one pattern and fiddling the list of bindings.</span><span>
</span><span id="line-401"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-402"></span><span>        </span><span class="hs-comment">-- POST CONDITION: head pattern in the EqnInfo is</span><span>
</span><span id="line-403"></span><span>        </span><span class="hs-comment">--      one of these for which patGroup is defined.</span><span>
</span><span id="line-404"></span><span>
</span><span id="line-405"></span><span id="tidyEqnInfo"><span class="annot"><span class="annottext">tidyEqnInfo :: Id
-&gt; EquationInfo
-&gt; IOEnv (Env DsGblEnv DsLclEnv) (DsWrapper, EquationInfo)
</span><a href="GHC.HsToCore.Match.html#tidyEqnInfo"><span class="hs-identifier hs-var hs-var">tidyEqnInfo</span></a></span></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Monad.html#EqnInfo"><span class="hs-identifier hs-type">EqnInfo</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">eqn_pats :: EquationInfo -&gt; [Pat GhcTc]
</span><a href="GHC.HsToCore.Monad.html#eqn_pats"><span class="hs-identifier hs-var">eqn_pats</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-406"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; IOEnv (Env DsGblEnv DsLclEnv) (DsWrapper, EquationInfo)
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tidyEqnInfo&quot;</span></span><span>
</span><span id="line-407"></span><span>
</span><span id="line-408"></span><span class="annot"><a href="GHC.HsToCore.Match.html#tidyEqnInfo"><span class="hs-identifier hs-var">tidyEqnInfo</span></a></span><span> </span><span id="local-6989586621681143804"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143804"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621681143803"><span class="annot"><span class="annottext">eqn :: EquationInfo
</span><a href="#local-6989586621681143803"><span class="hs-identifier hs-var">eqn</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Monad.html#EqnInfo"><span class="hs-identifier hs-type">EqnInfo</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">eqn_pats :: EquationInfo -&gt; [Pat GhcTc]
</span><a href="GHC.HsToCore.Monad.html#eqn_pats"><span class="hs-identifier hs-var">eqn_pats</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681143802"><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143802"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681143801"><span class="annot"><span class="annottext">[Pat GhcTc]
</span><a href="#local-6989586621681143801"><span class="hs-identifier hs-var">pats</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">eqn_orig :: EquationInfo -&gt; Origin
</span><a href="GHC.HsToCore.Monad.html#eqn_orig"><span class="hs-identifier hs-var">eqn_orig</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681143799"><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143799"><span class="hs-identifier hs-var">orig</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-409"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681143798"><span class="annot"><span class="annottext">DsWrapper
</span><a href="#local-6989586621681143798"><span class="hs-identifier hs-var">wrap</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681143797"><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143797"><span class="hs-identifier hs-var">pat'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Origin -&gt; Pat GhcTc -&gt; DsM (DsWrapper, Pat GhcTc)
</span><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-var">tidy1</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143804"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143799"><span class="hs-identifier hs-var">orig</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143802"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-410"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(DsWrapper, EquationInfo)
-&gt; IOEnv (Env DsGblEnv DsLclEnv) (DsWrapper, EquationInfo)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsWrapper
</span><a href="#local-6989586621681143798"><span class="hs-identifier hs-var">wrap</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681143803"><span class="hs-identifier hs-var">eqn</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">eqn_pats :: [Pat GhcTc]
</span><a href="GHC.HsToCore.Monad.html#eqn_pats"><span class="hs-identifier hs-var">eqn_pats</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143797"><span class="hs-identifier hs-var">pat'</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc -&gt; [Pat GhcTc] -&gt; [Pat GhcTc]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[Pat GhcTc]
</span><a href="#local-6989586621681143801"><span class="hs-identifier hs-var">pats</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-411"></span><span>
</span><span id="line-412"></span><span class="annot"><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-type">tidy1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>                  </span><span class="hs-comment">-- The Id being scrutinised</span><span>
</span><span id="line-413"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Origin"><span class="hs-identifier hs-type">Origin</span></a></span><span>              </span><span class="hs-comment">-- Was this a pattern the user wrote?</span><span>
</span><span id="line-414"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#Pat"><span class="hs-identifier hs-type">Pat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>           </span><span class="hs-comment">-- The pattern against which it is to be matched</span><span>
</span><span id="line-415"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Monad.html#DsWrapper"><span class="hs-identifier hs-type">DsWrapper</span></a></span><span class="hs-special">,</span><span>     </span><span class="hs-comment">-- Extra bindings to do before the match</span><span>
</span><span id="line-416"></span><span>              </span><span class="annot"><a href="GHC.Hs.Pat.html#Pat"><span class="hs-identifier hs-type">Pat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span>     </span><span class="hs-comment">-- Equivalent pattern</span><span>
</span><span id="line-417"></span><span>
</span><span id="line-418"></span><span class="hs-comment">-------------------------------------------------------</span><span>
</span><span id="line-419"></span><span class="hs-comment">--      (pat', mr') = tidy1 v pat mr</span><span>
</span><span id="line-420"></span><span class="hs-comment">-- tidies the *outer level only* of pat, giving pat'</span><span>
</span><span id="line-421"></span><span class="hs-comment">-- It eliminates many pattern forms (as-patterns, variable patterns,</span><span>
</span><span id="line-422"></span><span class="hs-comment">-- list patterns, etc) and returns any created bindings in the wrapper.</span><span>
</span><span id="line-423"></span><span>
</span><span id="line-424"></span><span id="tidy1"><span class="annot"><span class="annottext">tidy1 :: Id -&gt; Origin -&gt; Pat GhcTc -&gt; DsM (DsWrapper, Pat GhcTc)
</span><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-var hs-var">tidy1</span></a></span></span><span> </span><span id="local-6989586621681143795"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143795"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621681143794"><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143794"><span class="hs-identifier hs-var">o</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#ParPat"><span class="hs-identifier hs-type">ParPat</span></a></span><span> </span><span class="annot"><span class="annottext">XParPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143792"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681143792"><span class="hs-identifier hs-var">pat</span></a></span></span><span class="hs-special">)</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Origin -&gt; Pat GhcTc -&gt; DsM (DsWrapper, Pat GhcTc)
</span><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-var">tidy1</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143795"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143794"><span class="hs-identifier hs-var">o</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc) -&gt; Pat GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681143792"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-425"></span><span class="annot"><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-var">tidy1</span></a></span><span> </span><span id="local-6989586621681143791"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143791"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621681143790"><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143790"><span class="hs-identifier hs-var">o</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#SigPat"><span class="hs-identifier hs-type">SigPat</span></a></span><span> </span><span class="annot"><span class="annottext">XSigPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143788"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681143788"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span class="annot"><span class="annottext">HsPatSigType (NoGhcTc GhcTc)
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Origin -&gt; Pat GhcTc -&gt; DsM (DsWrapper, Pat GhcTc)
</span><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-var">tidy1</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143791"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143790"><span class="hs-identifier hs-var">o</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc) -&gt; Pat GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681143788"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-426"></span><span class="annot"><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-var">tidy1</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Origin
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#WildPat"><span class="hs-identifier hs-type">WildPat</span></a></span><span> </span><span id="local-6989586621681143786"><span class="annot"><span class="annottext">XWildPat GhcTc
</span><a href="#local-6989586621681143786"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(DsWrapper, Pat GhcTc) -&gt; DsM (DsWrapper, Pat GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsWrapper
</span><a href="GHC.HsToCore.Monad.html#idDsWrapper"><span class="hs-identifier hs-var">idDsWrapper</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">XWildPat GhcTc -&gt; Pat GhcTc
forall p. XWildPat p -&gt; Pat p
</span><a href="GHC.Hs.Pat.html#WildPat"><span class="hs-identifier hs-var">WildPat</span></a></span><span> </span><span class="annot"><span class="annottext">XWildPat GhcTc
</span><a href="#local-6989586621681143786"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-427"></span><span class="annot"><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-var">tidy1</span></a></span><span> </span><span id="local-6989586621681143784"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143784"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621681143783"><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143783"><span class="hs-identifier hs-var">o</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#BangPat"><span class="hs-identifier hs-type">BangPat</span></a></span><span> </span><span class="annot"><span class="annottext">XBangPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681143782"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681143782"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681143781"><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143781"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Origin -&gt; SrcSpan -&gt; Pat GhcTc -&gt; DsM (DsWrapper, Pat GhcTc)
</span><a href="GHC.HsToCore.Match.html#tidy_bang_pat"><span class="hs-identifier hs-var">tidy_bang_pat</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143784"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143783"><span class="hs-identifier hs-var">o</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681143782"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143781"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-428"></span><span>
</span><span id="line-429"></span><span>        </span><span class="hs-comment">-- case v of { x -&gt; mr[] }</span><span>
</span><span id="line-430"></span><span>        </span><span class="hs-comment">-- = case v of { _ -&gt; let x=v in mr[] }</span><span>
</span><span id="line-431"></span><span class="annot"><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-var">tidy1</span></a></span><span> </span><span id="local-6989586621681143779"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143779"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="annot"><span class="annottext">Origin
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#VarPat"><span class="hs-identifier hs-type">VarPat</span></a></span><span> </span><span class="annot"><span class="annottext">XVarPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143777"><span class="annot"><span class="annottext">IdP GhcTc
</span><a href="#local-6989586621681143777"><span class="hs-identifier hs-var">var</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-432"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(DsWrapper, Pat GhcTc) -&gt; DsM (DsWrapper, Pat GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Id -&gt; DsWrapper
</span><a href="GHC.HsToCore.Utils.html#wrapBind"><span class="hs-identifier hs-var">wrapBind</span></a></span><span> </span><span class="annot"><span class="annottext">Id
IdP GhcTc
</span><a href="#local-6989586621681143777"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143779"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">XWildPat GhcTc -&gt; Pat GhcTc
forall p. XWildPat p -&gt; Pat p
</span><a href="GHC.Hs.Pat.html#WildPat"><span class="hs-identifier hs-var">WildPat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
IdP GhcTc
</span><a href="#local-6989586621681143777"><span class="hs-identifier hs-var">var</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-433"></span><span>
</span><span id="line-434"></span><span>        </span><span class="hs-comment">-- case v of { x@p -&gt; mr[] }</span><span>
</span><span id="line-435"></span><span>        </span><span class="hs-comment">-- = case v of { p -&gt; let x=v in mr[] }</span><span>
</span><span id="line-436"></span><span class="annot"><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-var">tidy1</span></a></span><span> </span><span id="local-6989586621681143774"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143774"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621681143773"><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143773"><span class="hs-identifier hs-var">o</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#AsPat"><span class="hs-identifier hs-type">AsPat</span></a></span><span> </span><span class="annot"><span class="annottext">XAsPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143771"><span class="annot"><span class="annottext">IdP GhcTc
</span><a href="#local-6989586621681143771"><span class="hs-identifier hs-var">var</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681143770"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681143770"><span class="hs-identifier hs-var">pat</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-437"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681143769"><span class="annot"><span class="annottext">DsWrapper
</span><a href="#local-6989586621681143769"><span class="hs-identifier hs-var">wrap</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681143768"><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143768"><span class="hs-identifier hs-var">pat'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Origin -&gt; Pat GhcTc -&gt; DsM (DsWrapper, Pat GhcTc)
</span><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-var">tidy1</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143774"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143773"><span class="hs-identifier hs-var">o</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc) -&gt; Pat GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681143770"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-438"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(DsWrapper, Pat GhcTc) -&gt; DsM (DsWrapper, Pat GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Id -&gt; DsWrapper
</span><a href="GHC.HsToCore.Utils.html#wrapBind"><span class="hs-identifier hs-var">wrapBind</span></a></span><span> </span><span class="annot"><span class="annottext">Id
IdP GhcTc
</span><a href="#local-6989586621681143771"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143774"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">DsWrapper -&gt; DsWrapper -&gt; DsWrapper
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">DsWrapper
</span><a href="#local-6989586621681143769"><span class="hs-identifier hs-var">wrap</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143768"><span class="hs-identifier hs-var">pat'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-439"></span><span>
</span><span id="line-440"></span><span class="hs-comment">{- now, here we handle lazy patterns:
    tidy1 v ~p bs = (v, v1 = case v of p -&gt; v1 :
                        v2 = case v of p -&gt; v2 : ... : bs )

    where the v_i's are the binders in the pattern.

    ToDo: in &quot;v_i = ... -&gt; v_i&quot;, are the v_i's really the same thing?

    The case expr for v_i is just: match [v] [(p, [], \ x -&gt; Var v_i)] any_expr
-}</span><span>
</span><span id="line-450"></span><span>
</span><span id="line-451"></span><span class="annot"><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-var">tidy1</span></a></span><span> </span><span id="local-6989586621681143767"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143767"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="annot"><span class="annottext">Origin
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#LazyPat"><span class="hs-identifier hs-type">LazyPat</span></a></span><span> </span><span class="annot"><span class="annottext">XLazyPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143765"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681143765"><span class="hs-identifier hs-var">pat</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-452"></span><span>    </span><span class="hs-comment">-- This is a convenient place to check for unlifted types under a lazy pattern.</span><span>
</span><span id="line-453"></span><span>    </span><span class="hs-comment">-- Doing this check during type-checking is unsatisfactory because we may</span><span>
</span><span id="line-454"></span><span>    </span><span class="hs-comment">-- not fully know the zonked types yet. We sure do here.</span><span>
</span><span id="line-455"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681143764"><span class="annot"><span class="annottext">unlifted_bndrs :: [Id]
</span><a href="#local-6989586621681143764"><span class="hs-identifier hs-var hs-var">unlifted_bndrs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Bool) -&gt; [Id] -&gt; [Id]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Kind -&gt; Bool
Kind -&gt; Bool
</span><a href="GHC.Core.Type.html#isUnliftedType"><span class="hs-identifier hs-var">isUnliftedType</span></a></span><span> </span><span class="annot"><span class="annottext">(Kind -&gt; Bool) -&gt; (Id -&gt; Kind) -&gt; Id -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LPat GhcTc -&gt; [IdP GhcTc]
forall p. CollectPass p =&gt; LPat p -&gt; [IdP p]
</span><a href="GHC.Hs.Utils.html#collectPatBinders"><span class="hs-identifier hs-var">collectPatBinders</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681143765"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-456"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; TcRnIf DsGblEnv DsLclEnv () -&gt; TcRnIf DsGblEnv DsLclEnv ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681143764"><span class="hs-identifier hs-var">unlifted_bndrs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcRnIf DsGblEnv DsLclEnv () -&gt; TcRnIf DsGblEnv DsLclEnv ())
-&gt; TcRnIf DsGblEnv DsLclEnv () -&gt; TcRnIf DsGblEnv DsLclEnv ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-457"></span><span>          </span><span class="annot"><span class="annottext">SrcSpan
-&gt; TcRnIf DsGblEnv DsLclEnv () -&gt; TcRnIf DsGblEnv DsLclEnv ()
forall a. SrcSpan -&gt; DsM a -&gt; DsM a
</span><a href="GHC.HsToCore.Monad.html#putSrcSpanDs"><span class="hs-identifier hs-var">putSrcSpanDs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc) -&gt; SrcSpan
forall l e. GenLocated l e -&gt; l
</span><a href="GHC.Types.SrcLoc.html#getLoc"><span class="hs-identifier hs-var">getLoc</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681143765"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcRnIf DsGblEnv DsLclEnv () -&gt; TcRnIf DsGblEnv DsLclEnv ())
-&gt; TcRnIf DsGblEnv DsLclEnv () -&gt; TcRnIf DsGblEnv DsLclEnv ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-458"></span><span>          </span><span class="annot"><span class="annottext">SDoc -&gt; TcRnIf DsGblEnv DsLclEnv ()
</span><a href="GHC.HsToCore.Monad.html#errDs"><span class="hs-identifier hs-var">errDs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; Int -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;A lazy (~) pattern cannot bind variables of unlifted type.&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-459"></span><span>                       </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Unlifted variables:&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-460"></span><span>                    </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id -&gt; SDoc) -&gt; [Id] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681143756"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143756"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Id -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143756"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#dcolon"><span class="hs-identifier hs-var">dcolon</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Kind -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143756"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-461"></span><span>                                 </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681143764"><span class="hs-identifier hs-var">unlifted_bndrs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-462"></span><span>
</span><span id="line-463"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621681143754"><span class="annot"><span class="annottext">[(Id, CoreExpr)]
</span><a href="#local-6989586621681143754"><span class="hs-identifier hs-var">sel_prs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[[Tickish Id]]
-&gt; LPat GhcTc -&gt; CoreExpr -&gt; DsM (Id, [(Id, CoreExpr)])
</span><a href="GHC.HsToCore.Utils.html#mkSelectorBinds"><span class="hs-identifier hs-var">mkSelectorBinds</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681143765"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143767"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-464"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681143752"><span class="annot"><span class="annottext">sel_binds :: [Bind Id]
</span><a href="#local-6989586621681143752"><span class="hs-identifier hs-var hs-var">sel_binds</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>  </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; Bind Id
forall b. b -&gt; Expr b -&gt; Bind b
</span><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-var">NonRec</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143751"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681143750"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681143751"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143751"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681143750"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681143750"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(Id, CoreExpr)]
</span><a href="#local-6989586621681143754"><span class="hs-identifier hs-var">sel_prs</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-465"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(DsWrapper, Pat GhcTc) -&gt; DsM (DsWrapper, Pat GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Bind Id] -&gt; DsWrapper
</span><a href="GHC.Core.Make.html#mkCoreLets"><span class="hs-identifier hs-var">mkCoreLets</span></a></span><span> </span><span class="annot"><span class="annottext">[Bind Id]
</span><a href="#local-6989586621681143752"><span class="hs-identifier hs-var">sel_binds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">XWildPat GhcTc -&gt; Pat GhcTc
forall p. XWildPat p -&gt; Pat p
</span><a href="GHC.Hs.Pat.html#WildPat"><span class="hs-identifier hs-var">WildPat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143767"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-466"></span><span>
</span><span id="line-467"></span><span class="annot"><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-var">tidy1</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Origin
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#ListPat"><span class="hs-identifier hs-type">ListPat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#ListPatTc"><span class="hs-identifier hs-type">ListPatTc</span></a></span><span> </span><span id="local-6989586621681143748"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143748"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe (Kind, SyntaxExpr GhcTc)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681143747"><span class="annot"><span class="annottext">[LPat GhcTc]
</span><a href="#local-6989586621681143747"><span class="hs-identifier hs-var">pats</span></a></span></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-468"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(DsWrapper, Pat GhcTc) -&gt; DsM (DsWrapper, Pat GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsWrapper
</span><a href="GHC.HsToCore.Monad.html#idDsWrapper"><span class="hs-identifier hs-var">idDsWrapper</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc) -&gt; Pat GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc)
</span><a href="#local-6989586621681143746"><span class="hs-identifier hs-var">list_ConPat</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-469"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-470"></span><span>    </span><span id="local-6989586621681143746"><span class="annot"><span class="annottext">list_ConPat :: GenLocated SrcSpan (Pat GhcTc)
</span><a href="#local-6989586621681143746"><span class="hs-identifier hs-var hs-var">list_ConPat</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(GenLocated SrcSpan (Pat GhcTc)
 -&gt; GenLocated SrcSpan (Pat GhcTc)
 -&gt; GenLocated SrcSpan (Pat GhcTc))
-&gt; GenLocated SrcSpan (Pat GhcTc)
-&gt; [GenLocated SrcSpan (Pat GhcTc)]
-&gt; GenLocated SrcSpan (Pat GhcTc)
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621681143745"><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc)
</span><a href="#local-6989586621681143745"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681143744"><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc)
</span><a href="#local-6989586621681143744"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [LPat GhcTc] -&gt; [Kind] -&gt; LPat GhcTc
</span><a href="GHC.Hs.Pat.html#mkPrefixConPat"><span class="hs-identifier hs-var">mkPrefixConPat</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#consDataCon"><span class="hs-identifier hs-var">consDataCon</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Item [GenLocated SrcSpan (Pat GhcTc)]
GenLocated SrcSpan (Pat GhcTc)
</span><a href="#local-6989586621681143745"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Item [GenLocated SrcSpan (Pat GhcTc)]
GenLocated SrcSpan (Pat GhcTc)
</span><a href="#local-6989586621681143744"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Item [Kind]
Kind
</span><a href="#local-6989586621681143748"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-471"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Kind -&gt; LPat GhcTc
</span><a href="GHC.Hs.Pat.html#mkNilPat"><span class="hs-identifier hs-var">mkNilPat</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143748"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-472"></span><span>                        </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (Pat GhcTc)]
[LPat GhcTc]
</span><a href="#local-6989586621681143747"><span class="hs-identifier hs-var">pats</span></a></span><span>
</span><span id="line-473"></span><span>
</span><span id="line-474"></span><span class="annot"><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-var">tidy1</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Origin
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#TuplePat"><span class="hs-identifier hs-type">TuplePat</span></a></span><span> </span><span id="local-6989586621681143739"><span class="annot"><span class="annottext">XTuplePat GhcTc
</span><a href="#local-6989586621681143739"><span class="hs-identifier hs-var">tys</span></a></span></span><span> </span><span id="local-6989586621681143738"><span class="annot"><span class="annottext">[LPat GhcTc]
</span><a href="#local-6989586621681143738"><span class="hs-identifier hs-var">pats</span></a></span></span><span> </span><span id="local-6989586621681143737"><span class="annot"><span class="annottext">Boxity
</span><a href="#local-6989586621681143737"><span class="hs-identifier hs-var">boxity</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-475"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(DsWrapper, Pat GhcTc) -&gt; DsM (DsWrapper, Pat GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsWrapper
</span><a href="GHC.HsToCore.Monad.html#idDsWrapper"><span class="hs-identifier hs-var">idDsWrapper</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc) -&gt; Pat GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681143736"><span class="hs-identifier hs-var">tuple_ConPat</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-476"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-477"></span><span>    </span><span id="local-6989586621681143735"><span class="annot"><span class="annottext">arity :: Int
</span><a href="#local-6989586621681143735"><span class="hs-identifier hs-var hs-var">arity</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (Pat GhcTc)] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (Pat GhcTc)]
[LPat GhcTc]
</span><a href="#local-6989586621681143738"><span class="hs-identifier hs-var">pats</span></a></span><span>
</span><span id="line-478"></span><span>    </span><span id="local-6989586621681143736"><span class="annot"><span class="annottext">tuple_ConPat :: LPat GhcTc
</span><a href="#local-6989586621681143736"><span class="hs-identifier hs-var hs-var">tuple_ConPat</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [LPat GhcTc] -&gt; [Kind] -&gt; LPat GhcTc
</span><a href="GHC.Hs.Pat.html#mkPrefixConPat"><span class="hs-identifier hs-var">mkPrefixConPat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Boxity -&gt; Int -&gt; DataCon
</span><a href="GHC.Builtin.Types.html#tupleDataCon"><span class="hs-identifier hs-var">tupleDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">Boxity
</span><a href="#local-6989586621681143737"><span class="hs-identifier hs-var">boxity</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681143735"><span class="hs-identifier hs-var">arity</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LPat GhcTc]
</span><a href="#local-6989586621681143738"><span class="hs-identifier hs-var">pats</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681143732"><span class="hs-identifier hs-var">tys'</span></a></span><span>
</span><span id="line-479"></span><span>    </span><span id="local-6989586621681143732"><span class="annot"><span class="annottext">tys' :: [Kind]
</span><a href="#local-6989586621681143732"><span class="hs-identifier hs-var hs-var">tys'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Boxity
</span><a href="#local-6989586621681143737"><span class="hs-identifier hs-var">boxity</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-480"></span><span>             </span><span class="annot"><span class="annottext">Boxity
</span><a href="GHC.Types.Basic.html#Unboxed"><span class="hs-identifier hs-var">Unboxed</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Kind -&gt; Kind) -&gt; [Kind] -&gt; [Kind]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Kind -&gt; Kind
Kind -&gt; Kind
</span><a href="GHC.Core.Type.html#getRuntimeRep"><span class="hs-identifier hs-var">getRuntimeRep</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
XTuplePat GhcTc
</span><a href="#local-6989586621681143739"><span class="hs-identifier hs-var">tys</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind] -&gt; [Kind] -&gt; [Kind]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
XTuplePat GhcTc
</span><a href="#local-6989586621681143739"><span class="hs-identifier hs-var">tys</span></a></span><span>
</span><span id="line-481"></span><span>             </span><span class="annot"><span class="annottext">Boxity
</span><a href="GHC.Types.Basic.html#Boxed"><span class="hs-identifier hs-var">Boxed</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Kind]
XTuplePat GhcTc
</span><a href="#local-6989586621681143739"><span class="hs-identifier hs-var">tys</span></a></span><span>
</span><span id="line-482"></span><span>           </span><span class="hs-comment">-- See Note [Unboxed tuple RuntimeRep vars] in TyCon</span><span>
</span><span id="line-483"></span><span>
</span><span id="line-484"></span><span class="annot"><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-var">tidy1</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Origin
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#SumPat"><span class="hs-identifier hs-type">SumPat</span></a></span><span> </span><span id="local-6989586621681143727"><span class="annot"><span class="annottext">XSumPat GhcTc
</span><a href="#local-6989586621681143727"><span class="hs-identifier hs-var">tys</span></a></span></span><span> </span><span id="local-6989586621681143726"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681143726"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621681143725"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681143725"><span class="hs-identifier hs-var">alt</span></a></span></span><span> </span><span id="local-6989586621681143724"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681143724"><span class="hs-identifier hs-var">arity</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-485"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(DsWrapper, Pat GhcTc) -&gt; DsM (DsWrapper, Pat GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsWrapper
</span><a href="GHC.HsToCore.Monad.html#idDsWrapper"><span class="hs-identifier hs-var">idDsWrapper</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc) -&gt; Pat GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681143723"><span class="hs-identifier hs-var">sum_ConPat</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-486"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-487"></span><span>    </span><span id="local-6989586621681143723"><span class="annot"><span class="annottext">sum_ConPat :: LPat GhcTc
</span><a href="#local-6989586621681143723"><span class="hs-identifier hs-var hs-var">sum_ConPat</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [LPat GhcTc] -&gt; [Kind] -&gt; LPat GhcTc
</span><a href="GHC.Hs.Pat.html#mkPrefixConPat"><span class="hs-identifier hs-var">mkPrefixConPat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; DataCon
</span><a href="GHC.Builtin.Types.html#sumDataCon"><span class="hs-identifier hs-var">sumDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681143725"><span class="hs-identifier hs-var">alt</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681143724"><span class="hs-identifier hs-var">arity</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Item [GenLocated SrcSpan (Pat GhcTc)]
LPat GhcTc
</span><a href="#local-6989586621681143726"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Kind -&gt; Kind) -&gt; [Kind] -&gt; [Kind]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Kind -&gt; Kind
Kind -&gt; Kind
</span><a href="GHC.Core.Type.html#getRuntimeRep"><span class="hs-identifier hs-var">getRuntimeRep</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
XSumPat GhcTc
</span><a href="#local-6989586621681143727"><span class="hs-identifier hs-var">tys</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind] -&gt; [Kind] -&gt; [Kind]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
XSumPat GhcTc
</span><a href="#local-6989586621681143727"><span class="hs-identifier hs-var">tys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-488"></span><span>                 </span><span class="hs-comment">-- See Note [Unboxed tuple RuntimeRep vars] in TyCon</span><span>
</span><span id="line-489"></span><span>
</span><span id="line-490"></span><span class="hs-comment">-- LitPats: we *might* be able to replace these w/ a simpler form</span><span>
</span><span id="line-491"></span><span class="annot"><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-var">tidy1</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143721"><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143721"><span class="hs-identifier hs-var">o</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#LitPat"><span class="hs-identifier hs-type">LitPat</span></a></span><span> </span><span class="annot"><span class="annottext">XLitPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143719"><span class="annot"><span class="annottext">HsLit GhcTc
</span><a href="#local-6989586621681143719"><span class="hs-identifier hs-var">lit</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-492"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; TcRnIf DsGblEnv DsLclEnv () -&gt; TcRnIf DsGblEnv DsLclEnv ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Origin -&gt; Bool
</span><a href="GHC.Types.Basic.html#isGenerated"><span class="hs-identifier hs-var">isGenerated</span></a></span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143721"><span class="hs-identifier hs-var">o</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcRnIf DsGblEnv DsLclEnv () -&gt; TcRnIf DsGblEnv DsLclEnv ())
-&gt; TcRnIf DsGblEnv DsLclEnv () -&gt; TcRnIf DsGblEnv DsLclEnv ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-493"></span><span>           </span><span class="annot"><span class="annottext">HsLit GhcTc -&gt; TcRnIf DsGblEnv DsLclEnv ()
</span><a href="GHC.HsToCore.Match.Literal.html#warnAboutOverflowedLit"><span class="hs-identifier hs-var">warnAboutOverflowedLit</span></a></span><span> </span><span class="annot"><span class="annottext">HsLit GhcTc
</span><a href="#local-6989586621681143719"><span class="hs-identifier hs-var">lit</span></a></span><span>
</span><span id="line-494"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(DsWrapper, Pat GhcTc) -&gt; DsM (DsWrapper, Pat GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsWrapper
</span><a href="GHC.HsToCore.Monad.html#idDsWrapper"><span class="hs-identifier hs-var">idDsWrapper</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HsLit GhcTc -&gt; Pat GhcTc
</span><a href="GHC.HsToCore.Match.Literal.html#tidyLitPat"><span class="hs-identifier hs-var">tidyLitPat</span></a></span><span> </span><span class="annot"><span class="annottext">HsLit GhcTc
</span><a href="#local-6989586621681143719"><span class="hs-identifier hs-var">lit</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-495"></span><span>
</span><span id="line-496"></span><span class="hs-comment">-- NPats: we *might* be able to replace these w/ a simpler form</span><span>
</span><span id="line-497"></span><span class="annot"><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-var">tidy1</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143716"><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143716"><span class="hs-identifier hs-var">o</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#NPat"><span class="hs-identifier hs-type">NPat</span></a></span><span> </span><span id="local-6989586621681143714"><span class="annot"><span class="annottext">XNPat GhcTc
</span><a href="#local-6989586621681143714"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143713"><span class="annot"><span class="annottext">lit :: HsOverLit GhcTc
</span><a href="#local-6989586621681143713"><span class="hs-identifier hs-var">lit</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Hs.Lit.html#OverLit"><span class="hs-identifier hs-type">OverLit</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ol_val :: forall p. HsOverLit p -&gt; OverLitVal
</span><a href="GHC.Hs.Lit.html#ol_val"><span class="hs-identifier hs-var">ol_val</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681143710"><span class="annot"><span class="annottext">OverLitVal
</span><a href="#local-6989586621681143710"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681143709"><span class="annot"><span class="annottext">Maybe (SyntaxExpr GhcTc)
</span><a href="#local-6989586621681143709"><span class="hs-identifier hs-var">mb_neg</span></a></span></span><span> </span><span id="local-6989586621681143708"><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681143708"><span class="hs-identifier hs-var">eq</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-498"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; TcRnIf DsGblEnv DsLclEnv () -&gt; TcRnIf DsGblEnv DsLclEnv ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Origin -&gt; Bool
</span><a href="GHC.Types.Basic.html#isGenerated"><span class="hs-identifier hs-var">isGenerated</span></a></span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143716"><span class="hs-identifier hs-var">o</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcRnIf DsGblEnv DsLclEnv () -&gt; TcRnIf DsGblEnv DsLclEnv ())
-&gt; TcRnIf DsGblEnv DsLclEnv () -&gt; TcRnIf DsGblEnv DsLclEnv ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-499"></span><span>           </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681143707"><span class="annot"><span class="annottext">lit' :: HsOverLit GhcTc
</span><a href="#local-6989586621681143707"><span class="hs-identifier hs-var hs-var">lit'</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe (SyntaxExpr GhcTc)
</span><a href="#local-6989586621681143709"><span class="hs-identifier hs-var">mb_neg</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><a href="#local-6989586621681143713"><span class="hs-identifier hs-var">lit</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ol_val :: OverLitVal
</span><a href="GHC.Hs.Lit.html#ol_val"><span class="hs-identifier hs-var">ol_val</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OverLitVal -&gt; OverLitVal
</span><a href="GHC.Hs.Lit.html#negateOverLitVal"><span class="hs-identifier hs-var">negateOverLitVal</span></a></span><span> </span><span class="annot"><span class="annottext">OverLitVal
</span><a href="#local-6989586621681143710"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-500"></span><span>                    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><a href="#local-6989586621681143713"><span class="hs-identifier hs-var">lit</span></a></span><span>
</span><span id="line-501"></span><span>           </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc -&gt; TcRnIf DsGblEnv DsLclEnv ()
</span><a href="GHC.HsToCore.Match.Literal.html#warnAboutOverflowedOverLit"><span class="hs-identifier hs-var">warnAboutOverflowedOverLit</span></a></span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><a href="#local-6989586621681143707"><span class="hs-identifier hs-var">lit'</span></a></span><span>
</span><span id="line-502"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(DsWrapper, Pat GhcTc) -&gt; DsM (DsWrapper, Pat GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsWrapper
</span><a href="GHC.HsToCore.Monad.html#idDsWrapper"><span class="hs-identifier hs-var">idDsWrapper</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc
-&gt; Maybe (SyntaxExpr GhcTc)
-&gt; SyntaxExpr GhcTc
-&gt; Kind
-&gt; Pat GhcTc
</span><a href="GHC.HsToCore.Match.Literal.html#tidyNPat"><span class="hs-identifier hs-var">tidyNPat</span></a></span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><a href="#local-6989586621681143713"><span class="hs-identifier hs-var">lit</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (SyntaxExpr GhcTc)
</span><a href="#local-6989586621681143709"><span class="hs-identifier hs-var">mb_neg</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681143708"><span class="hs-identifier hs-var">eq</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
XNPat GhcTc
</span><a href="#local-6989586621681143714"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-503"></span><span>
</span><span id="line-504"></span><span class="hs-comment">-- NPlusKPat: we may want to warn about the literals</span><span>
</span><span id="line-505"></span><span class="annot"><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-var">tidy1</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143703"><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143703"><span class="hs-identifier hs-var">o</span></a></span></span><span> </span><span id="local-6989586621681143702"><span class="annot"><span class="annottext">n :: Pat GhcTc
</span><a href="#local-6989586621681143702"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#NPlusKPat"><span class="hs-identifier hs-type">NPlusKPat</span></a></span><span> </span><span class="annot"><span class="annottext">XNPlusKPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (IdP GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143700"><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><a href="#local-6989586621681143700"><span class="hs-identifier hs-var">lit1</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681143699"><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><a href="#local-6989586621681143699"><span class="hs-identifier hs-var">lit2</span></a></span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>
</span><span id="line-506"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; TcRnIf DsGblEnv DsLclEnv () -&gt; TcRnIf DsGblEnv DsLclEnv ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Origin -&gt; Bool
</span><a href="GHC.Types.Basic.html#isGenerated"><span class="hs-identifier hs-var">isGenerated</span></a></span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143703"><span class="hs-identifier hs-var">o</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcRnIf DsGblEnv DsLclEnv () -&gt; TcRnIf DsGblEnv DsLclEnv ())
-&gt; TcRnIf DsGblEnv DsLclEnv () -&gt; TcRnIf DsGblEnv DsLclEnv ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-507"></span><span>           </span><span class="annot"><span class="annottext">HsOverLit GhcTc -&gt; TcRnIf DsGblEnv DsLclEnv ()
</span><a href="GHC.HsToCore.Match.Literal.html#warnAboutOverflowedOverLit"><span class="hs-identifier hs-var">warnAboutOverflowedOverLit</span></a></span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><a href="#local-6989586621681143700"><span class="hs-identifier hs-var">lit1</span></a></span><span>
</span><span id="line-508"></span><span>           </span><span class="annot"><span class="annottext">HsOverLit GhcTc -&gt; TcRnIf DsGblEnv DsLclEnv ()
</span><a href="GHC.HsToCore.Match.Literal.html#warnAboutOverflowedOverLit"><span class="hs-identifier hs-var">warnAboutOverflowedOverLit</span></a></span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><a href="#local-6989586621681143699"><span class="hs-identifier hs-var">lit2</span></a></span><span>
</span><span id="line-509"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(DsWrapper, Pat GhcTc) -&gt; DsM (DsWrapper, Pat GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsWrapper
</span><a href="GHC.HsToCore.Monad.html#idDsWrapper"><span class="hs-identifier hs-var">idDsWrapper</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143702"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-510"></span><span>
</span><span id="line-511"></span><span class="hs-comment">-- Everything else goes through unchanged...</span><span>
</span><span id="line-512"></span><span class="annot"><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-var">tidy1</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Origin
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143698"><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143698"><span class="hs-identifier hs-var">non_interesting_pat</span></a></span></span><span>
</span><span id="line-513"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(DsWrapper, Pat GhcTc) -&gt; DsM (DsWrapper, Pat GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsWrapper
</span><a href="GHC.HsToCore.Monad.html#idDsWrapper"><span class="hs-identifier hs-var">idDsWrapper</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143698"><span class="hs-identifier hs-var">non_interesting_pat</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-514"></span><span>
</span><span id="line-515"></span><span class="hs-comment">--------------------</span><span>
</span><span id="line-516"></span><span class="annot"><a href="GHC.HsToCore.Match.html#tidy_bang_pat"><span class="hs-identifier hs-type">tidy_bang_pat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Origin"><span class="hs-identifier hs-type">Origin</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#Pat"><span class="hs-identifier hs-type">Pat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>
</span><span id="line-517"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Monad.html#DsWrapper"><span class="hs-identifier hs-type">DsWrapper</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#Pat"><span class="hs-identifier hs-type">Pat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-518"></span><span>
</span><span id="line-519"></span><span class="hs-comment">-- Discard par/sig under a bang</span><span>
</span><span id="line-520"></span><span id="tidy_bang_pat"><span class="annot"><span class="annottext">tidy_bang_pat :: Id -&gt; Origin -&gt; SrcSpan -&gt; Pat GhcTc -&gt; DsM (DsWrapper, Pat GhcTc)
</span><a href="GHC.HsToCore.Match.html#tidy_bang_pat"><span class="hs-identifier hs-var hs-var">tidy_bang_pat</span></a></span></span><span> </span><span id="local-6989586621681143697"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143697"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621681143696"><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143696"><span class="hs-identifier hs-var">o</span></a></span></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#ParPat"><span class="hs-identifier hs-type">ParPat</span></a></span><span> </span><span class="annot"><span class="annottext">XParPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681143695"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681143695"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681143694"><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143694"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Origin -&gt; SrcSpan -&gt; Pat GhcTc -&gt; DsM (DsWrapper, Pat GhcTc)
</span><a href="GHC.HsToCore.Match.html#tidy_bang_pat"><span class="hs-identifier hs-var">tidy_bang_pat</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143697"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143696"><span class="hs-identifier hs-var">o</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681143695"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143694"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-521"></span><span class="annot"><a href="GHC.HsToCore.Match.html#tidy_bang_pat"><span class="hs-identifier hs-var">tidy_bang_pat</span></a></span><span> </span><span id="local-6989586621681143693"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143693"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621681143692"><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143692"><span class="hs-identifier hs-var">o</span></a></span></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#SigPat"><span class="hs-identifier hs-type">SigPat</span></a></span><span> </span><span class="annot"><span class="annottext">XSigPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681143691"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681143691"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681143690"><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143690"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">HsPatSigType (NoGhcTc GhcTc)
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Origin -&gt; SrcSpan -&gt; Pat GhcTc -&gt; DsM (DsWrapper, Pat GhcTc)
</span><a href="GHC.HsToCore.Match.html#tidy_bang_pat"><span class="hs-identifier hs-var">tidy_bang_pat</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143693"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143692"><span class="hs-identifier hs-var">o</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681143691"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143690"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-522"></span><span>
</span><span id="line-523"></span><span class="hs-comment">-- Push the bang-pattern inwards, in the hope that</span><span>
</span><span id="line-524"></span><span class="hs-comment">-- it may disappear next time</span><span>
</span><span id="line-525"></span><span class="annot"><a href="GHC.HsToCore.Match.html#tidy_bang_pat"><span class="hs-identifier hs-var">tidy_bang_pat</span></a></span><span> </span><span id="local-6989586621681143689"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143689"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621681143688"><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143688"><span class="hs-identifier hs-var">o</span></a></span></span><span> </span><span id="local-6989586621681143687"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681143687"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#AsPat"><span class="hs-identifier hs-type">AsPat</span></a></span><span> </span><span id="local-6989586621681143686"><span class="annot"><span class="annottext">XAsPat GhcTc
</span><a href="#local-6989586621681143686"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681143685"><span class="annot"><span class="annottext">GenLocated SrcSpan (IdP GhcTc)
</span><a href="#local-6989586621681143685"><span class="hs-identifier hs-var">v'</span></a></span></span><span> </span><span id="local-6989586621681143684"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681143684"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-526"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Origin -&gt; Pat GhcTc -&gt; DsM (DsWrapper, Pat GhcTc)
</span><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-var">tidy1</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143689"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143688"><span class="hs-identifier hs-var">o</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XAsPat GhcTc
-&gt; GenLocated SrcSpan (IdP GhcTc) -&gt; LPat GhcTc -&gt; Pat GhcTc
forall p. XAsPat p -&gt; Located (IdP p) -&gt; LPat p -&gt; Pat p
</span><a href="GHC.Hs.Pat.html#AsPat"><span class="hs-identifier hs-var">AsPat</span></a></span><span> </span><span class="annot"><span class="annottext">XAsPat GhcTc
</span><a href="#local-6989586621681143686"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (IdP GhcTc)
</span><a href="#local-6989586621681143685"><span class="hs-identifier hs-var">v'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; Pat GhcTc -&gt; GenLocated SrcSpan (Pat GhcTc)
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681143687"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XBangPat GhcTc -&gt; LPat GhcTc -&gt; Pat GhcTc
forall p. XBangPat p -&gt; LPat p -&gt; Pat p
</span><a href="GHC.Hs.Pat.html#BangPat"><span class="hs-identifier hs-var">BangPat</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XBangPat GhcTc
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681143684"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-527"></span><span class="annot"><a href="GHC.HsToCore.Match.html#tidy_bang_pat"><span class="hs-identifier hs-var">tidy_bang_pat</span></a></span><span> </span><span id="local-6989586621681143682"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143682"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621681143681"><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143681"><span class="hs-identifier hs-var">o</span></a></span></span><span> </span><span id="local-6989586621681143680"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681143680"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#XPat"><span class="hs-identifier hs-type">XPat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#CoPat"><span class="hs-identifier hs-type">CoPat</span></a></span><span> </span><span id="local-6989586621681143679"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143679"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span id="local-6989586621681143678"><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143678"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621681143677"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143677"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-528"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Origin -&gt; Pat GhcTc -&gt; DsM (DsWrapper, Pat GhcTc)
</span><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-var">tidy1</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143682"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143681"><span class="hs-identifier hs-var">o</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XXPat GhcTc -&gt; Pat GhcTc
forall p. XXPat p -&gt; Pat p
</span><a href="GHC.Hs.Pat.html#XPat"><span class="hs-identifier hs-var">XPat</span></a></span><span> </span><span class="annot"><span class="annottext">(XXPat GhcTc -&gt; Pat GhcTc) -&gt; XXPat GhcTc -&gt; Pat GhcTc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper -&gt; Pat GhcTc -&gt; Kind -&gt; CoPat
</span><a href="GHC.Hs.Pat.html#CoPat"><span class="hs-identifier hs-var">CoPat</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143679"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XBangPat GhcTc -&gt; LPat GhcTc -&gt; Pat GhcTc
forall p. XBangPat p -&gt; LPat p -&gt; Pat p
</span><a href="GHC.Hs.Pat.html#BangPat"><span class="hs-identifier hs-var">BangPat</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XBangPat GhcTc
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; Pat GhcTc -&gt; GenLocated SrcSpan (Pat GhcTc)
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681143680"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143678"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143677"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-529"></span><span>
</span><span id="line-530"></span><span class="hs-comment">-- Discard bang around strict pattern</span><span>
</span><span id="line-531"></span><span class="annot"><a href="GHC.HsToCore.Match.html#tidy_bang_pat"><span class="hs-identifier hs-var">tidy_bang_pat</span></a></span><span> </span><span id="local-6989586621681143676"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143676"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621681143675"><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143675"><span class="hs-identifier hs-var">o</span></a></span></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143674"><span class="annot"><span class="annottext">p :: Pat GhcTc
</span><a href="#local-6989586621681143674"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#LitPat"><span class="hs-identifier hs-type">LitPat</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Origin -&gt; Pat GhcTc -&gt; DsM (DsWrapper, Pat GhcTc)
</span><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-var">tidy1</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143676"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143675"><span class="hs-identifier hs-var">o</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143674"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-532"></span><span class="annot"><a href="GHC.HsToCore.Match.html#tidy_bang_pat"><span class="hs-identifier hs-var">tidy_bang_pat</span></a></span><span> </span><span id="local-6989586621681143673"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143673"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621681143672"><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143672"><span class="hs-identifier hs-var">o</span></a></span></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143671"><span class="annot"><span class="annottext">p :: Pat GhcTc
</span><a href="#local-6989586621681143671"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#ListPat"><span class="hs-identifier hs-type">ListPat</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Origin -&gt; Pat GhcTc -&gt; DsM (DsWrapper, Pat GhcTc)
</span><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-var">tidy1</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143673"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143672"><span class="hs-identifier hs-var">o</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143671"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-533"></span><span class="annot"><a href="GHC.HsToCore.Match.html#tidy_bang_pat"><span class="hs-identifier hs-var">tidy_bang_pat</span></a></span><span> </span><span id="local-6989586621681143670"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143670"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621681143669"><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143669"><span class="hs-identifier hs-var">o</span></a></span></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143668"><span class="annot"><span class="annottext">p :: Pat GhcTc
</span><a href="#local-6989586621681143668"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#TuplePat"><span class="hs-identifier hs-type">TuplePat</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Origin -&gt; Pat GhcTc -&gt; DsM (DsWrapper, Pat GhcTc)
</span><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-var">tidy1</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143670"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143669"><span class="hs-identifier hs-var">o</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143668"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-534"></span><span class="annot"><a href="GHC.HsToCore.Match.html#tidy_bang_pat"><span class="hs-identifier hs-var">tidy_bang_pat</span></a></span><span> </span><span id="local-6989586621681143667"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143667"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621681143666"><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143666"><span class="hs-identifier hs-var">o</span></a></span></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143665"><span class="annot"><span class="annottext">p :: Pat GhcTc
</span><a href="#local-6989586621681143665"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#SumPat"><span class="hs-identifier hs-type">SumPat</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Origin -&gt; Pat GhcTc -&gt; DsM (DsWrapper, Pat GhcTc)
</span><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-var">tidy1</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143667"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143666"><span class="hs-identifier hs-var">o</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143665"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-535"></span><span>
</span><span id="line-536"></span><span class="hs-comment">-- Data/newtype constructors</span><span>
</span><span id="line-537"></span><span class="annot"><a href="GHC.HsToCore.Match.html#tidy_bang_pat"><span class="hs-identifier hs-var">tidy_bang_pat</span></a></span><span> </span><span id="local-6989586621681143664"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143664"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621681143663"><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143663"><span class="hs-identifier hs-var">o</span></a></span></span><span> </span><span id="local-6989586621681143662"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681143662"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681143661"><span class="annot"><span class="annottext">p :: Pat GhcTc
</span><a href="#local-6989586621681143661"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#ConPat"><span class="hs-identifier hs-type">ConPat</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">pat_con :: forall p. Pat p -&gt; Located (ConLikeP p)
</span><a href="GHC.Hs.Pat.html#pat_con"><span class="hs-identifier hs-var">pat_con</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.ConLike.html#RealDataCon"><span class="hs-identifier hs-type">RealDataCon</span></a></span><span> </span><span id="local-6989586621681143657"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681143657"><span class="hs-identifier hs-var">dc</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-538"></span><span>                              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">pat_args :: forall p. Pat p -&gt; HsConPatDetails p
</span><a href="GHC.Hs.Pat.html#pat_args"><span class="hs-identifier hs-var">pat_args</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681143655"><span class="annot"><span class="annottext">HsConPatDetails GhcTc
</span><a href="#local-6989586621681143655"><span class="hs-identifier hs-var">args</span></a></span></span><span>
</span><span id="line-539"></span><span>                              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">pat_con_ext :: forall p. Pat p -&gt; XConPat p
</span><a href="GHC.Hs.Pat.html#pat_con_ext"><span class="hs-identifier hs-var">pat_con_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#ConPatTc"><span class="hs-identifier hs-type">ConPatTc</span></a></span><span>
</span><span id="line-540"></span><span>                                </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cpt_arg_tys :: ConPatTc -&gt; [Kind]
</span><a href="GHC.Hs.Pat.html#cpt_arg_tys"><span class="hs-identifier hs-var">cpt_arg_tys</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681143651"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681143651"><span class="hs-identifier hs-var">arg_tys</span></a></span></span><span>
</span><span id="line-541"></span><span>                                </span><span class="hs-special">}</span><span>
</span><span id="line-542"></span><span>                              </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-543"></span><span>  </span><span class="hs-comment">-- Newtypes: push bang inwards (#9844)</span><span>
</span><span id="line-544"></span><span>  </span><span class="hs-glyph">=</span><span>
</span><span id="line-545"></span><span>    </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isNewTyCon"><span class="hs-identifier hs-var">isNewTyCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; TyCon
</span><a href="GHC.Core.DataCon.html#dataConTyCon"><span class="hs-identifier hs-var">dataConTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681143657"><span class="hs-identifier hs-var">dc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-546"></span><span>      </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Origin -&gt; Pat GhcTc -&gt; DsM (DsWrapper, Pat GhcTc)
</span><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-var">tidy1</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143664"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143663"><span class="hs-identifier hs-var">o</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143661"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">pat_args :: HsConPatDetails GhcTc
</span><a href="GHC.Hs.Pat.html#pat_args"><span class="hs-identifier hs-var">pat_args</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; Kind -&gt; HsConPatDetails GhcTc -&gt; HsConPatDetails GhcTc
</span><a href="GHC.HsToCore.Match.html#push_bang_into_newtype_arg"><span class="hs-identifier hs-var">push_bang_into_newtype_arg</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681143662"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Scaled Kind -&gt; Kind
forall a. Scaled a -&gt; a
</span><a href="GHC.Core.TyCo.Rep.html#scaledThing"><span class="hs-identifier hs-var">scaledThing</span></a></span><span> </span><span class="annot"><span class="annottext">Scaled Kind
</span><a href="#local-6989586621681143647"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">HsConPatDetails GhcTc
</span><a href="#local-6989586621681143655"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-547"></span><span>      </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Origin -&gt; Pat GhcTc -&gt; DsM (DsWrapper, Pat GhcTc)
</span><a href="GHC.HsToCore.Match.html#tidy1"><span class="hs-identifier hs-var">tidy1</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143664"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143663"><span class="hs-identifier hs-var">o</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143661"><span class="hs-identifier hs-var">p</span></a></span><span>  </span><span class="hs-comment">-- Data types: discard the bang</span><span>
</span><span id="line-548"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-549"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621681143647"><span class="annot"><span class="annottext">Scaled Kind
</span><a href="#local-6989586621681143647"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">[Scaled Kind]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [Kind] -&gt; [Scaled Kind]
</span><a href="GHC.Core.DataCon.html#dataConInstArgTys"><span class="hs-identifier hs-var">dataConInstArgTys</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681143657"><span class="hs-identifier hs-var">dc</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681143651"><span class="hs-identifier hs-var">arg_tys</span></a></span><span>
</span><span id="line-550"></span><span>
</span><span id="line-551"></span><span class="hs-comment">-------------------</span><span>
</span><span id="line-552"></span><span class="hs-comment">-- Default case, leave the bang there:</span><span>
</span><span id="line-553"></span><span class="hs-comment">--    VarPat,</span><span>
</span><span id="line-554"></span><span class="hs-comment">--    LazyPat,</span><span>
</span><span id="line-555"></span><span class="hs-comment">--    WildPat,</span><span>
</span><span id="line-556"></span><span class="hs-comment">--    ViewPat,</span><span>
</span><span id="line-557"></span><span class="hs-comment">--    pattern synonyms (ConPatOut with PatSynCon)</span><span>
</span><span id="line-558"></span><span class="hs-comment">--    NPat,</span><span>
</span><span id="line-559"></span><span class="hs-comment">--    NPlusKPat</span><span>
</span><span id="line-560"></span><span class="hs-comment">--</span><span>
</span><span id="line-561"></span><span class="hs-comment">-- For LazyPat, remember that it's semantically like a VarPat</span><span>
</span><span id="line-562"></span><span class="hs-comment">--  i.e.  !(~p) is not like ~p, or p!  (#8952)</span><span>
</span><span id="line-563"></span><span class="hs-comment">--</span><span>
</span><span id="line-564"></span><span class="hs-comment">-- NB: SigPatIn, ConPatIn should not happen</span><span>
</span><span id="line-565"></span><span>
</span><span id="line-566"></span><span class="annot"><a href="GHC.HsToCore.Match.html#tidy_bang_pat"><span class="hs-identifier hs-var">tidy_bang_pat</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Origin
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143645"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681143645"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681143644"><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143644"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(DsWrapper, Pat GhcTc) -&gt; DsM (DsWrapper, Pat GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsWrapper
</span><a href="GHC.HsToCore.Monad.html#idDsWrapper"><span class="hs-identifier hs-var">idDsWrapper</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">XBangPat GhcTc -&gt; LPat GhcTc -&gt; Pat GhcTc
forall p. XBangPat p -&gt; LPat p -&gt; Pat p
</span><a href="GHC.Hs.Pat.html#BangPat"><span class="hs-identifier hs-var">BangPat</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XBangPat GhcTc
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; Pat GhcTc -&gt; GenLocated SrcSpan (Pat GhcTc)
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681143645"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143644"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-567"></span><span>
</span><span id="line-568"></span><span class="hs-comment">-------------------</span><span>
</span><span id="line-569"></span><span class="annot"><a href="GHC.HsToCore.Match.html#push_bang_into_newtype_arg"><span class="hs-identifier hs-type">push_bang_into_newtype_arg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span>
</span><span id="line-570"></span><span>                           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-comment">-- The type of the argument we are pushing</span><span>
</span><span id="line-571"></span><span>                                   </span><span class="hs-comment">-- onto</span><span>
</span><span id="line-572"></span><span>                           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#HsConPatDetails"><span class="hs-identifier hs-type">HsConPatDetails</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#HsConPatDetails"><span class="hs-identifier hs-type">HsConPatDetails</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>
</span><span id="line-573"></span><span class="hs-comment">-- See Note [Bang patterns and newtypes]</span><span>
</span><span id="line-574"></span><span class="hs-comment">-- We are transforming   !(N p)   into   (N !p)</span><span>
</span><span id="line-575"></span><span id="push_bang_into_newtype_arg"><span class="annot"><span class="annottext">push_bang_into_newtype_arg :: SrcSpan -&gt; Kind -&gt; HsConPatDetails GhcTc -&gt; HsConPatDetails GhcTc
</span><a href="GHC.HsToCore.Match.html#push_bang_into_newtype_arg"><span class="hs-identifier hs-var hs-var">push_bang_into_newtype_arg</span></a></span></span><span> </span><span id="local-6989586621681143643"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681143643"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681143642"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143642"><span class="hs-identifier hs-var">_ty</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Type.html#PrefixCon"><span class="hs-identifier hs-type">PrefixCon</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681143640"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681143640"><span class="hs-identifier hs-var">arg</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681143639"><span class="annot"><span class="annottext">[LPat GhcTc]
</span><a href="#local-6989586621681143639"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-576"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">null</span><span> </span><span class="hs-identifier">args</span><span class="hs-special">)</span><span>
</span><span id="line-577"></span><span>    </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (Pat GhcTc)]
-&gt; HsConDetails
     (GenLocated SrcSpan (Pat GhcTc))
     (HsRecFields GhcTc (GenLocated SrcSpan (Pat GhcTc)))
forall arg rec. [arg] -&gt; HsConDetails arg rec
</span><a href="GHC.Hs.Type.html#PrefixCon"><span class="hs-identifier hs-var">PrefixCon</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">SrcSpan -&gt; Pat GhcTc -&gt; GenLocated SrcSpan (Pat GhcTc)
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681143643"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XBangPat GhcTc -&gt; LPat GhcTc -&gt; Pat GhcTc
forall p. XBangPat p -&gt; LPat p -&gt; Pat p
</span><a href="GHC.Hs.Pat.html#BangPat"><span class="hs-identifier hs-var">BangPat</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XBangPat GhcTc
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681143640"><span class="hs-identifier hs-var">arg</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-578"></span><span class="annot"><a href="GHC.HsToCore.Match.html#push_bang_into_newtype_arg"><span class="hs-identifier hs-var">push_bang_into_newtype_arg</span></a></span><span> </span><span id="local-6989586621681143638"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681143638"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681143637"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143637"><span class="hs-identifier hs-var">_ty</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Type.html#RecCon"><span class="hs-identifier hs-type">RecCon</span></a></span><span> </span><span id="local-6989586621681143635"><span class="annot"><span class="annottext">HsRecFields GhcTc (LPat GhcTc)
</span><a href="#local-6989586621681143635"><span class="hs-identifier hs-var">rf</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-579"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#HsRecFields"><span class="hs-identifier hs-type">HsRecFields</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">rec_flds :: forall p arg. HsRecFields p arg -&gt; [LHsRecField p arg]
</span><a href="GHC.Hs.Pat.html#rec_flds"><span class="hs-identifier hs-var">rec_flds</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681143632"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681143632"><span class="hs-identifier hs-var">lf</span></a></span></span><span> </span><span id="local-6989586621681143631"><span class="annot"><span class="annottext">HsRecField GhcTc (LPat GhcTc)
</span><a href="#local-6989586621681143631"><span class="hs-identifier hs-var">fld</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681143630"><span class="annot"><span class="annottext">[LHsRecField GhcTc (LPat GhcTc)]
</span><a href="#local-6989586621681143630"><span class="hs-identifier hs-var">flds</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsRecFields GhcTc (LPat GhcTc)
</span><a href="#local-6989586621681143635"><span class="hs-identifier hs-var">rf</span></a></span><span>
</span><span id="line-580"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#HsRecField"><span class="hs-identifier hs-type">HsRecField</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsRecFieldArg :: forall id arg. HsRecField' id arg -&gt; arg
</span><a href="GHC.Hs.Pat.html#hsRecFieldArg"><span class="hs-identifier hs-var">hsRecFieldArg</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681143627"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681143627"><span class="hs-identifier hs-var">arg</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsRecField GhcTc (LPat GhcTc)
</span><a href="#local-6989586621681143631"><span class="hs-identifier hs-var">fld</span></a></span><span>
</span><span id="line-581"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">null</span><span> </span><span class="hs-identifier">flds</span><span class="hs-special">)</span><span>
</span><span id="line-582"></span><span>    </span><span class="annot"><span class="annottext">HsRecFields GhcTc (GenLocated SrcSpan (Pat GhcTc))
-&gt; HsConDetails
     (GenLocated SrcSpan (Pat GhcTc))
     (HsRecFields GhcTc (GenLocated SrcSpan (Pat GhcTc)))
forall arg rec. rec -&gt; HsConDetails arg rec
</span><a href="GHC.Hs.Type.html#RecCon"><span class="hs-identifier hs-var">RecCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsRecFields GhcTc (GenLocated SrcSpan (Pat GhcTc))
HsRecFields GhcTc (LPat GhcTc)
</span><a href="#local-6989586621681143635"><span class="hs-identifier hs-var">rf</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">rec_flds :: [LHsRecField GhcTc (GenLocated SrcSpan (Pat GhcTc))]
</span><a href="GHC.Hs.Pat.html#rec_flds"><span class="hs-identifier hs-var">rec_flds</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">SrcSpan
-&gt; HsRecField' (FieldOcc GhcTc) (GenLocated SrcSpan (Pat GhcTc))
-&gt; LHsRecField GhcTc (GenLocated SrcSpan (Pat GhcTc))
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681143632"><span class="hs-identifier hs-var">lf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsRecField' (FieldOcc GhcTc) (GenLocated SrcSpan (Pat GhcTc))
HsRecField GhcTc (LPat GhcTc)
</span><a href="#local-6989586621681143631"><span class="hs-identifier hs-var">fld</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsRecFieldArg :: GenLocated SrcSpan (Pat GhcTc)
</span><a href="GHC.Hs.Pat.html#hsRecFieldArg"><span class="hs-identifier hs-var">hsRecFieldArg</span></a></span><span>
</span><span id="line-583"></span><span>                                           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; Pat GhcTc -&gt; GenLocated SrcSpan (Pat GhcTc)
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681143638"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XBangPat GhcTc -&gt; LPat GhcTc -&gt; Pat GhcTc
forall p. XBangPat p -&gt; LPat p -&gt; Pat p
</span><a href="GHC.Hs.Pat.html#BangPat"><span class="hs-identifier hs-var">BangPat</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XBangPat GhcTc
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681143627"><span class="hs-identifier hs-var">arg</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-584"></span><span class="annot"><a href="GHC.HsToCore.Match.html#push_bang_into_newtype_arg"><span class="hs-identifier hs-var">push_bang_into_newtype_arg</span></a></span><span> </span><span id="local-6989586621681143626"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681143626"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681143625"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143625"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Type.html#RecCon"><span class="hs-identifier hs-type">RecCon</span></a></span><span> </span><span id="local-6989586621681143624"><span class="annot"><span class="annottext">HsRecFields GhcTc (LPat GhcTc)
</span><a href="#local-6989586621681143624"><span class="hs-identifier hs-var">rf</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- If a user writes !(T {})</span><span>
</span><span id="line-585"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#HsRecFields"><span class="hs-identifier hs-type">HsRecFields</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">rec_flds :: forall p arg. HsRecFields p arg -&gt; [LHsRecField p arg]
</span><a href="GHC.Hs.Pat.html#rec_flds"><span class="hs-identifier hs-var">rec_flds</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsRecFields GhcTc (LPat GhcTc)
</span><a href="#local-6989586621681143624"><span class="hs-identifier hs-var">rf</span></a></span><span>
</span><span id="line-586"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (Pat GhcTc)]
-&gt; HsConDetails
     (GenLocated SrcSpan (Pat GhcTc))
     (HsRecFields GhcTc (GenLocated SrcSpan (Pat GhcTc)))
forall arg rec. [arg] -&gt; HsConDetails arg rec
</span><a href="GHC.Hs.Type.html#PrefixCon"><span class="hs-identifier hs-var">PrefixCon</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">SrcSpan -&gt; Pat GhcTc -&gt; GenLocated SrcSpan (Pat GhcTc)
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681143626"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XBangPat GhcTc -&gt; LPat GhcTc -&gt; Pat GhcTc
forall p. XBangPat p -&gt; LPat p -&gt; Pat p
</span><a href="GHC.Hs.Pat.html#BangPat"><span class="hs-identifier hs-var">BangPat</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XBangPat GhcTc
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Pat GhcTc -&gt; GenLocated SrcSpan (Pat GhcTc)
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XWildPat GhcTc -&gt; Pat GhcTc
forall p. XWildPat p -&gt; Pat p
</span><a href="GHC.Hs.Pat.html#WildPat"><span class="hs-identifier hs-var">WildPat</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
XWildPat GhcTc
</span><a href="#local-6989586621681143625"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-587"></span><span class="annot"><a href="GHC.HsToCore.Match.html#push_bang_into_newtype_arg"><span class="hs-identifier hs-var">push_bang_into_newtype_arg</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Kind
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143622"><span class="annot"><span class="annottext">HsConPatDetails GhcTc
</span><a href="#local-6989586621681143622"><span class="hs-identifier hs-var">cd</span></a></span></span><span>
</span><span id="line-588"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
-&gt; SDoc
-&gt; HsConDetails
     (GenLocated SrcSpan (Pat GhcTc))
     (HsRecFields GhcTc (GenLocated SrcSpan (Pat GhcTc)))
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;push_bang_into_newtype_arg&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsConPatDetails GhcTc -&gt; SDoc
forall (p :: Pass).
OutputableBndrId p =&gt;
HsConPatDetails (GhcPass p) -&gt; SDoc
</span><a href="GHC.Hs.Pat.html#pprConArgs"><span class="hs-identifier hs-var">pprConArgs</span></a></span><span> </span><span class="annot"><span class="annottext">HsConPatDetails GhcTc
</span><a href="#local-6989586621681143622"><span class="hs-identifier hs-var">cd</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-589"></span><span>
</span><span id="line-590"></span><span class="hs-comment">{-
Note [Bang patterns and newtypes]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For the pattern  !(Just pat)  we can discard the bang, because
the pattern is strict anyway. But for !(N pat), where
  newtype NT = N Int
we definitely can't discard the bang.  #9844.

So what we do is to push the bang inwards, in the hope that it will
get discarded there.  So we transform
   !(N pat)   into    (N !pat)

But what if there is nothing to push the bang onto? In at least one instance
a user has written !(N {}) which we translate into (N !_). See #13215


\noindent
{\bf Previous @matchTwiddled@ stuff:}

Now we get to the only interesting part; note: there are choices for
translation [from Simon's notes]; translation~1:
\begin{verbatim}
deTwiddle [s,t] e
\end{verbatim}
returns
\begin{verbatim}
[ w = e,
  s = case w of [s,t] -&gt; s
  t = case w of [s,t] -&gt; t
]
\end{verbatim}

Here \tr{w} is a fresh variable, and the \tr{w}-binding prevents multiple
evaluation of \tr{e}.  An alternative translation (No.~2):
\begin{verbatim}
[ w = case e of [s,t] -&gt; (s,t)
  s = case w of (s,t) -&gt; s
  t = case w of (s,t) -&gt; t
]
\end{verbatim}

************************************************************************
*                                                                      *
\subsubsection[improved-unmixing]{UNIMPLEMENTED idea for improved unmixing}
*                                                                      *
************************************************************************

We might be able to optimise unmixing when confronted by
only-one-constructor-possible, of which tuples are the most notable
examples.  Consider:
\begin{verbatim}
f (a,b,c) ... = ...
f d ... (e:f) = ...
f (g,h,i) ... = ...
f j ...       = ...
\end{verbatim}
This definition would normally be unmixed into four equation blocks,
one per equation.  But it could be unmixed into just one equation
block, because if the one equation matches (on the first column),
the others certainly will.

You have to be careful, though; the example
\begin{verbatim}
f j ...       = ...
-------------------
f (a,b,c) ... = ...
f d ... (e:f) = ...
f (g,h,i) ... = ...
\end{verbatim}
{\em must} be broken into two blocks at the line shown; otherwise, you
are forcing unnecessary evaluation.  In any case, the top-left pattern
always gives the cue.  You could then unmix blocks into groups of...
\begin{description}
\item[all variables:]
As it is now.
\item[constructors or variables (mixed):]
Need to make sure the right names get bound for the variable patterns.
\item[literals or variables (mixed):]
Presumably just a variant on the constructor case (as it is now).
\end{description}

************************************************************************
*                                                                      *
*  matchWrapper: a convenient way to call @match@                      *
*                                                                      *
************************************************************************
\subsection[matchWrapper]{@matchWrapper@: a convenient interface to @match@}

Calls to @match@ often involve similar (non-trivial) work; that work
is collected here, in @matchWrapper@.  This function takes as
arguments:
\begin{itemize}
\item
Typechecked @Matches@ (of a function definition, or a case or lambda
expression)---the main input;
\item
An error message to be inserted into any (runtime) pattern-matching
failure messages.
\end{itemize}

As results, @matchWrapper@ produces:
\begin{itemize}
\item
A list of variables (@Locals@) that the caller must ``promise'' to
bind to appropriate values; and
\item
a @CoreExpr@, the desugared output (main result).
\end{itemize}

The main actions of @matchWrapper@ include:
\begin{enumerate}
\item
Flatten the @[TypecheckedMatch]@ into a suitable list of
@EquationInfo@s.
\item
Create as many new variables as there are patterns in a pattern-list
(in any one of the @EquationInfo@s).
\item
Create a suitable ``if it fails'' expression---a call to @error@ using
the error-string input; the {\em type} of this fail value can be found
by examining one of the RHS expressions in one of the @EquationInfo@s.
\item
Call @match@ with all of this information!
\end{enumerate}
-}</span><span>
</span><span id="line-715"></span><span>
</span><span id="line-716"></span><span class="annot"><a href="GHC.HsToCore.Match.html#matchWrapper"><span class="hs-identifier hs-type">matchWrapper</span></a></span><span>
</span><span id="line-717"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsMatchContext"><span class="hs-identifier hs-type">HsMatchContext</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>              </span><span class="hs-comment">-- ^ For shadowing warning messages</span><span>
</span><span id="line-718"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span>             </span><span class="hs-comment">-- ^ Scrutinee. (Just scrut) for a case expr</span><span>
</span><span id="line-719"></span><span>                                       </span><span class="hs-comment">--      case scrut of { p1 -&gt; e1 ... }</span><span>
</span><span id="line-720"></span><span>                                       </span><span class="hs-comment">--   (and in this case the MatchGroup will</span><span>
</span><span id="line-721"></span><span>                                       </span><span class="hs-comment">--    have all singleton patterns)</span><span>
</span><span id="line-722"></span><span>                                       </span><span class="hs-comment">--   Nothing for a function definition</span><span>
</span><span id="line-723"></span><span>                                       </span><span class="hs-comment">--      f p1 q1 = ...  -- No &quot;scrutinee&quot;</span><span>
</span><span id="line-724"></span><span>                                       </span><span class="hs-comment">--      f p2 q2 = ...  -- in this case</span><span>
</span><span id="line-725"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#MatchGroup"><span class="hs-identifier hs-type">MatchGroup</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- ^ Matches being desugared</span><span>
</span><span id="line-726"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>              </span><span class="hs-comment">-- ^ Results (usually passed to 'match')</span><span>
</span><span id="line-727"></span><span>
</span><span id="line-728"></span><span class="hs-comment">{-
 There is one small problem with the Lambda Patterns, when somebody
 writes something similar to:
\begin{verbatim}
    (\ (x:xs) -&gt; ...)
\end{verbatim}
 he/she don't want a warning about incomplete patterns, that is done with
 the flag @opt_WarnSimplePatterns@.
 This problem also appears in the:
\begin{itemize}
\item @do@ patterns, but if the @do@ can fail
      it creates another equation if the match can fail
      (see @GHC.HsToCore.Expr.doDo@ function)
\item @let@ patterns, are treated by @matchSimply@
   List Comprension Patterns, are treated by @matchSimply@ also
\end{itemize}

We can't call @matchSimply@ with Lambda patterns,
due to the fact that lambda patterns can have more than
one pattern, and match simply only accepts one pattern.

JJQC 30-Nov-1997
-}</span><span>
</span><span id="line-751"></span><span>
</span><span id="line-752"></span><span id="matchWrapper"><span class="annot"><span class="annottext">matchWrapper :: HsMatchContext GhcRn
-&gt; Maybe (LHsExpr GhcTc)
-&gt; MatchGroup GhcTc (LHsExpr GhcTc)
-&gt; DsM ([Id], CoreExpr)
</span><a href="GHC.HsToCore.Match.html#matchWrapper"><span class="hs-identifier hs-var hs-var">matchWrapper</span></a></span></span><span> </span><span id="local-6989586621681143620"><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681143620"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681143619"><span class="annot"><span class="annottext">Maybe (LHsExpr GhcTc)
</span><a href="#local-6989586621681143619"><span class="hs-identifier hs-var">mb_scr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#MG"><span class="hs-identifier hs-type">MG</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mg_alts :: forall p body. MatchGroup p body -&gt; Located [LMatch p body]
</span><a href="GHC.Hs.Expr.html#mg_alts"><span class="hs-identifier hs-var">mg_alts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143616"><span class="annot"><span class="annottext">[GenLocated SrcSpan (Match GhcTc (LHsExpr GhcTc))]
</span><a href="#local-6989586621681143616"><span class="hs-identifier hs-var">matches</span></a></span></span><span>
</span><span id="line-753"></span><span>                             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_ext :: forall p body. MatchGroup p body -&gt; XMG p body
</span><a href="GHC.Hs.Expr.html#mg_ext"><span class="hs-identifier hs-var">mg_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#MatchGroupTc"><span class="hs-identifier hs-type">MatchGroupTc</span></a></span><span> </span><span id="local-6989586621681143613"><span class="annot"><span class="annottext">[Scaled Kind]
</span><a href="#local-6989586621681143613"><span class="hs-identifier hs-var">arg_tys</span></a></span></span><span> </span><span id="local-6989586621681143612"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143612"><span class="hs-identifier hs-var">rhs_ty</span></a></span></span><span>
</span><span id="line-754"></span><span>                             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_origin :: forall p body. MatchGroup p body -&gt; Origin
</span><a href="GHC.Hs.Expr.html#mg_origin"><span class="hs-identifier hs-var">mg_origin</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681143610"><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143610"><span class="hs-identifier hs-var">origin</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-755"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681143609"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681143609"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env DsGblEnv DsLclEnv) DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-756"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681143608"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681143608"><span class="hs-identifier hs-var">locn</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DsM SrcSpan
</span><a href="GHC.HsToCore.Monad.html#getSrcSpanDs"><span class="hs-identifier hs-var">getSrcSpanDs</span></a></span><span>
</span><span id="line-757"></span><span>
</span><span id="line-758"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681143606"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681143606"><span class="hs-identifier hs-var">new_vars</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (Match GhcTc (LHsExpr GhcTc))]
</span><a href="#local-6989586621681143616"><span class="hs-identifier hs-var">matches</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-759"></span><span>                           </span><span class="hs-special">[</span><span class="hs-special">]</span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Scaled Kind] -&gt; IOEnv (Env DsGblEnv DsLclEnv) [Id]
</span><a href="GHC.HsToCore.Monad.html#newSysLocalsDsNoLP"><span class="hs-identifier hs-var">newSysLocalsDsNoLP</span></a></span><span> </span><span class="annot"><span class="annottext">[Scaled Kind]
</span><a href="#local-6989586621681143613"><span class="hs-identifier hs-var">arg_tys</span></a></span><span>
</span><span id="line-760"></span><span>                           </span><span class="hs-special">(</span><span id="local-6989586621681143604"><span class="annot"><span class="annottext">GenLocated SrcSpan (Match GhcTc (LHsExpr GhcTc))
</span><a href="#local-6989586621681143604"><span class="hs-identifier hs-var">m</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">[GenLocated SrcSpan (Match GhcTc (LHsExpr GhcTc))]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-761"></span><span>                            </span><span class="annot"><span class="annottext">[(Kind, Pat GhcTc)] -&gt; IOEnv (Env DsGblEnv DsLclEnv) [Id]
</span><a href="GHC.HsToCore.Utils.html#selectMatchVars"><span class="hs-identifier hs-var">selectMatchVars</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
-&gt; (Scaled Kind
    -&gt; GenLocated SrcSpan (Pat GhcTc) -&gt; (Kind, Pat GhcTc))
-&gt; [Scaled Kind]
-&gt; [GenLocated SrcSpan (Pat GhcTc)]
-&gt; [(Kind, Pat GhcTc)]
forall a b c. String -&gt; (a -&gt; b -&gt; c) -&gt; [a] -&gt; [b] -&gt; [c]
</span><a href="GHC.Utils.Misc.html#zipWithEqual"><span class="hs-identifier hs-var">zipWithEqual</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;matchWrapper&quot;</span></span><span>
</span><span id="line-762"></span><span>                                              </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681143601"><span class="annot"><span class="annottext">Scaled Kind
</span><a href="#local-6989586621681143601"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621681143600"><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc)
</span><a href="#local-6989586621681143600"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Scaled Kind -&gt; Kind
forall a. Scaled a -&gt; Kind
</span><a href="GHC.Core.TyCo.Rep.html#scaledMult"><span class="hs-identifier hs-var">scaledMult</span></a></span><span> </span><span class="annot"><span class="annottext">Scaled Kind
</span><a href="#local-6989586621681143601"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc) -&gt; Pat GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc)
</span><a href="#local-6989586621681143600"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-763"></span><span>                                                </span><span class="annot"><span class="annottext">[Scaled Kind]
</span><a href="#local-6989586621681143613"><span class="hs-identifier hs-var">arg_tys</span></a></span><span>
</span><span id="line-764"></span><span>                                                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenLocated SrcSpan (Match GhcTc (LHsExpr GhcTc)) -&gt; [LPat GhcTc]
forall (id :: Pass) body.
LMatch (GhcPass id) body -&gt; [LPat (GhcPass id)]
</span><a href="GHC.Hs.Expr.html#hsLMatchPats"><span class="hs-identifier hs-var">hsLMatchPats</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Match GhcTc (LHsExpr GhcTc))
</span><a href="#local-6989586621681143604"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-765"></span><span>
</span><span id="line-766"></span><span>        </span><span class="hs-comment">-- Pattern match check warnings for /this match-group/.</span><span>
</span><span id="line-767"></span><span>        </span><span class="hs-comment">-- @rhss_deltas@ is a flat list of covered Deltas for each RHS.</span><span>
</span><span id="line-768"></span><span>        </span><span class="hs-comment">-- Each Match will split off one Deltas for its RHSs from this.</span><span>
</span><span id="line-769"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681143597"><span class="annot"><span class="annottext">[Deltas]
</span><a href="#local-6989586621681143597"><span class="hs-identifier hs-var">rhss_deltas</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Origin -&gt; HsMatchContext GhcRn -&gt; Bool
forall id. DynFlags -&gt; Origin -&gt; HsMatchContext id -&gt; Bool
</span><a href="GHC.HsToCore.PmCheck.html#isMatchContextPmChecked"><span class="hs-identifier hs-var">isMatchContextPmChecked</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681143609"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143610"><span class="hs-identifier hs-var">origin</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681143620"><span class="hs-identifier hs-var">ctxt</span></a></span><span>
</span><span id="line-770"></span><span>            </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Maybe (LHsExpr GhcTc) -&gt; [Id] -&gt; DsM [Deltas] -&gt; DsM [Deltas]
forall a. Maybe (LHsExpr GhcTc) -&gt; [Id] -&gt; DsM a -&gt; DsM a
</span><a href="GHC.HsToCore.PmCheck.html#addScrutTmCs"><span class="hs-identifier hs-var">addScrutTmCs</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (LHsExpr GhcTc)
</span><a href="#local-6989586621681143619"><span class="hs-identifier hs-var">mb_scr</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681143606"><span class="hs-identifier hs-var">new_vars</span></a></span><span> </span><span class="annot"><span class="annottext">(DsM [Deltas] -&gt; DsM [Deltas]) -&gt; DsM [Deltas] -&gt; DsM [Deltas]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-771"></span><span>              </span><span class="hs-comment">-- See Note [Type and Term Equality Propagation]</span><span>
</span><span id="line-772"></span><span>              </span><span class="annot"><span class="annottext">DsMatchContext
-&gt; [Id]
-&gt; [GenLocated SrcSpan (Match GhcTc (LHsExpr GhcTc))]
-&gt; DsM [Deltas]
</span><a href="GHC.HsToCore.PmCheck.html#checkMatches"><span class="hs-identifier hs-var">checkMatches</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsMatchContext GhcRn -&gt; SrcSpan -&gt; DsMatchContext
</span><a href="GHC.HsToCore.Monad.html#DsMatchContext"><span class="hs-identifier hs-var">DsMatchContext</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681143620"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681143608"><span class="hs-identifier hs-var">locn</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681143606"><span class="hs-identifier hs-var">new_vars</span></a></span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (Match GhcTc (LHsExpr GhcTc))]
</span><a href="#local-6989586621681143616"><span class="hs-identifier hs-var">matches</span></a></span><span>
</span><span id="line-773"></span><span>            </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">[Deltas] -&gt; DsM [Deltas]
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- Ultimately this will result in passing Nothing</span><span>
</span><span id="line-774"></span><span>                         </span><span class="hs-comment">-- to dsGRHSs as match_deltas</span><span>
</span><span id="line-775"></span><span>
</span><span id="line-776"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681143592"><span class="annot"><span class="annottext">[EquationInfo]
</span><a href="#local-6989586621681143592"><span class="hs-identifier hs-var">eqns_info</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (Match GhcTc (LHsExpr GhcTc))]
-&gt; [Deltas] -&gt; IOEnv (Env DsGblEnv DsLclEnv) [EquationInfo]
</span><a href="#local-6989586621681143591"><span class="hs-identifier hs-var">mk_eqn_infos</span></a></span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (Match GhcTc (LHsExpr GhcTc))]
</span><a href="#local-6989586621681143616"><span class="hs-identifier hs-var">matches</span></a></span><span> </span><span class="annot"><span class="annottext">[Deltas]
</span><a href="#local-6989586621681143597"><span class="hs-identifier hs-var">rhss_deltas</span></a></span><span>
</span><span id="line-777"></span><span>
</span><span id="line-778"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681143590"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681143590"><span class="hs-identifier hs-var">result_expr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DsM CoreExpr -&gt; DsM CoreExpr
</span><a href="#local-6989586621681143589"><span class="hs-identifier hs-var">handleWarnings</span></a></span><span> </span><span class="annot"><span class="annottext">(DsM CoreExpr -&gt; DsM CoreExpr) -&gt; DsM CoreExpr -&gt; DsM CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-779"></span><span>                         </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; [Id] -&gt; [EquationInfo] -&gt; Kind -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Match.html#matchEquations"><span class="hs-identifier hs-var">matchEquations</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681143620"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681143606"><span class="hs-identifier hs-var">new_vars</span></a></span><span> </span><span class="annot"><span class="annottext">[EquationInfo]
</span><a href="#local-6989586621681143592"><span class="hs-identifier hs-var">eqns_info</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143612"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span>
</span><span id="line-780"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([Id], CoreExpr) -&gt; DsM ([Id], CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681143606"><span class="hs-identifier hs-var">new_vars</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681143590"><span class="hs-identifier hs-var">result_expr</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-781"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-782"></span><span>    </span><span class="hs-comment">-- rhss_deltas is a flat list, whereas there are multiple GRHSs per match.</span><span>
</span><span id="line-783"></span><span>    </span><span class="hs-comment">-- mk_eqn_infos will thread rhss_deltas as state through calls to</span><span>
</span><span id="line-784"></span><span>    </span><span class="hs-comment">-- mk_eqn_info, distributing each rhss_deltas to a GRHS.</span><span>
</span><span id="line-785"></span><span>    </span><span id="local-6989586621681143591"><span class="annot"><span class="annottext">mk_eqn_infos :: [GenLocated SrcSpan (Match GhcTc (LHsExpr GhcTc))]
-&gt; [Deltas] -&gt; IOEnv (Env DsGblEnv DsLclEnv) [EquationInfo]
</span><a href="#local-6989586621681143591"><span class="hs-identifier hs-var hs-var">mk_eqn_infos</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143588"><span class="annot"><span class="annottext">Match GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681143588"><span class="hs-identifier hs-var">match</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681143587"><span class="annot"><span class="annottext">[GenLocated SrcSpan (Match GhcTc (LHsExpr GhcTc))]
</span><a href="#local-6989586621681143587"><span class="hs-identifier hs-var">matches</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681143586"><span class="annot"><span class="annottext">[Deltas]
</span><a href="#local-6989586621681143586"><span class="hs-identifier hs-var">rhss_deltas</span></a></span></span><span>
</span><span id="line-786"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681143585"><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681143585"><span class="hs-identifier hs-var">info</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681143584"><span class="annot"><span class="annottext">[Deltas]
</span><a href="#local-6989586621681143584"><span class="hs-identifier hs-var">rhss_deltas'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Match GhcTc (LHsExpr GhcTc)
-&gt; [Deltas]
-&gt; IOEnv (Env DsGblEnv DsLclEnv) (EquationInfo, [Deltas])
</span><a href="#local-6989586621681143583"><span class="hs-identifier hs-var">mk_eqn_info</span></a></span><span>  </span><span class="annot"><span class="annottext">Match GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681143588"><span class="hs-identifier hs-var">match</span></a></span><span>   </span><span class="annot"><span class="annottext">[Deltas]
</span><a href="#local-6989586621681143586"><span class="hs-identifier hs-var">rhss_deltas</span></a></span><span>
</span><span id="line-787"></span><span>           </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681143582"><span class="annot"><span class="annottext">[EquationInfo]
</span><a href="#local-6989586621681143582"><span class="hs-identifier hs-var">infos</span></a></span></span><span>                </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (Match GhcTc (LHsExpr GhcTc))]
-&gt; [Deltas] -&gt; IOEnv (Env DsGblEnv DsLclEnv) [EquationInfo]
</span><a href="#local-6989586621681143591"><span class="hs-identifier hs-var">mk_eqn_infos</span></a></span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (Match GhcTc (LHsExpr GhcTc))]
</span><a href="#local-6989586621681143587"><span class="hs-identifier hs-var">matches</span></a></span><span> </span><span class="annot"><span class="annottext">[Deltas]
</span><a href="#local-6989586621681143584"><span class="hs-identifier hs-var">rhss_deltas'</span></a></span><span>
</span><span id="line-788"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[EquationInfo] -&gt; IOEnv (Env DsGblEnv DsLclEnv) [EquationInfo]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681143585"><span class="hs-identifier hs-var">info</span></a></span><span class="annot"><span class="annottext">EquationInfo -&gt; [EquationInfo] -&gt; [EquationInfo]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[EquationInfo]
</span><a href="#local-6989586621681143582"><span class="hs-identifier hs-var">infos</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-789"></span><span>    </span><span class="annot"><a href="#local-6989586621681143591"><span class="hs-identifier hs-var">mk_eqn_infos</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[Deltas]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[EquationInfo] -&gt; IOEnv (Env DsGblEnv DsLclEnv) [EquationInfo]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-790"></span><span>    </span><span class="hs-comment">-- Called once per equation in the match, or alternative in the case</span><span>
</span><span id="line-791"></span><span>    </span><span id="local-6989586621681143583"><span class="annot"><span class="annottext">mk_eqn_info :: Match GhcTc (LHsExpr GhcTc)
-&gt; [Deltas]
-&gt; IOEnv (Env DsGblEnv DsLclEnv) (EquationInfo, [Deltas])
</span><a href="#local-6989586621681143583"><span class="hs-identifier hs-var hs-var">mk_eqn_info</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#Match"><span class="hs-identifier hs-type">Match</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">m_pats :: forall p body. Match p body -&gt; [LPat p]
</span><a href="GHC.Hs.Expr.html#m_pats"><span class="hs-identifier hs-var">m_pats</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681143579"><span class="annot"><span class="annottext">[LPat GhcTc]
</span><a href="#local-6989586621681143579"><span class="hs-identifier hs-var">pats</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">m_grhss :: forall p body. Match p body -&gt; GRHSs p body
</span><a href="GHC.Hs.Expr.html#m_grhss"><span class="hs-identifier hs-var">m_grhss</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681143577"><span class="annot"><span class="annottext">GRHSs GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681143577"><span class="hs-identifier hs-var">grhss</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681143576"><span class="annot"><span class="annottext">[Deltas]
</span><a href="#local-6989586621681143576"><span class="hs-identifier hs-var">rhss_deltas</span></a></span></span><span>
</span><span id="line-792"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#GRHSs"><span class="hs-identifier hs-type">GRHSs</span></a></span><span> </span><span class="annot"><span class="annottext">XCGRHSs GhcTc (LHsExpr GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143574"><span class="annot"><span class="annottext">[LGRHS GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681143574"><span class="hs-identifier hs-var">grhss'</span></a></span></span><span> </span><span class="annot"><span class="annottext">LHsLocalBinds GhcTc
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">GRHSs GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681143577"><span class="hs-identifier hs-var">grhss</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681143573"><span class="annot"><span class="annottext">n_grhss :: Int
</span><a href="#local-6989586621681143573"><span class="hs-identifier hs-var hs-var">n_grhss</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[LGRHS GhcTc (LHsExpr GhcTc)] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[LGRHS GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681143574"><span class="hs-identifier hs-var">grhss'</span></a></span><span>
</span><span id="line-793"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681143572"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681143572"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env DsGblEnv DsLclEnv) DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-794"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681143571"><span class="annot"><span class="annottext">upats :: [Pat GhcTc]
</span><a href="#local-6989586621681143571"><span class="hs-identifier hs-var hs-var">upats</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(GenLocated SrcSpan (Pat GhcTc) -&gt; Pat GhcTc)
-&gt; [GenLocated SrcSpan (Pat GhcTc)] -&gt; [Pat GhcTc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc) -&gt; Pat GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">(GenLocated SrcSpan (Pat GhcTc) -&gt; Pat GhcTc)
-&gt; (GenLocated SrcSpan (Pat GhcTc)
    -&gt; GenLocated SrcSpan (Pat GhcTc))
-&gt; GenLocated SrcSpan (Pat GhcTc)
-&gt; Pat GhcTc
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; LPat GhcTc -&gt; LPat GhcTc
</span><a href="GHC.HsToCore.Utils.html#decideBangHood"><span class="hs-identifier hs-var">decideBangHood</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681143572"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (Pat GhcTc)]
[LPat GhcTc]
</span><a href="#local-6989586621681143579"><span class="hs-identifier hs-var">pats</span></a></span><span>
</span><span id="line-795"></span><span>           </span><span class="hs-comment">-- Split off one Deltas for each GRHS of the current Match from the</span><span>
</span><span id="line-796"></span><span>           </span><span class="hs-comment">-- flat list of GRHS Deltas *for all matches* (see the call to</span><span>
</span><span id="line-797"></span><span>           </span><span class="hs-comment">-- checkMatches above).</span><span>
</span><span id="line-798"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681143569"><span class="annot"><span class="annottext">[Deltas]
</span><a href="#local-6989586621681143569"><span class="hs-identifier hs-var">match_deltas</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681143568"><span class="annot"><span class="annottext">[Deltas]
</span><a href="#local-6989586621681143568"><span class="hs-identifier hs-var">rhss_deltas'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Deltas] -&gt; ([Deltas], [Deltas])
forall a. Int -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/GHC.List.html#splitAt"><span class="hs-identifier hs-var">splitAt</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681143573"><span class="hs-identifier hs-var">n_grhss</span></a></span><span> </span><span class="annot"><span class="annottext">[Deltas]
</span><a href="#local-6989586621681143576"><span class="hs-identifier hs-var">rhss_deltas</span></a></span><span>
</span><span id="line-799"></span><span>           </span><span class="hs-comment">-- The list of Deltas is empty iff we don't perform any coverage</span><span>
</span><span id="line-800"></span><span>           </span><span class="hs-comment">-- checking, in which case nonEmpty does the right thing by passing</span><span>
</span><span id="line-801"></span><span>           </span><span class="hs-comment">-- Nothing.</span><span>
</span><span id="line-802"></span><span>           </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681143566"><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681143566"><span class="hs-identifier hs-var">match_result</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; GRHSs GhcTc (LHsExpr GhcTc)
-&gt; Kind
-&gt; Maybe (NonEmpty Deltas)
-&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.GuardedRHSs.html#dsGRHSs"><span class="hs-identifier hs-var">dsGRHSs</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681143620"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">GRHSs GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681143577"><span class="hs-identifier hs-var">grhss</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143612"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Deltas] -&gt; Maybe (NonEmpty Deltas)
forall a. [a] -&gt; Maybe (NonEmpty a)
</span><a href="../../base/src/Data.List.NonEmpty.html#nonEmpty"><span class="hs-identifier hs-var">NEL.nonEmpty</span></a></span><span> </span><span class="annot"><span class="annottext">[Deltas]
</span><a href="#local-6989586621681143569"><span class="hs-identifier hs-var">match_deltas</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-803"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(EquationInfo, [Deltas])
-&gt; IOEnv (Env DsGblEnv DsLclEnv) (EquationInfo, [Deltas])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">EqnInfo :: [Pat GhcTc] -&gt; Origin -&gt; MatchResult CoreExpr -&gt; EquationInfo
</span><a href="GHC.HsToCore.Monad.html#EqnInfo"><span class="hs-identifier hs-type">EqnInfo</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">eqn_pats :: [Pat GhcTc]
</span><a href="GHC.HsToCore.Monad.html#eqn_pats"><span class="hs-identifier hs-var">eqn_pats</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Pat GhcTc]
</span><a href="#local-6989586621681143571"><span class="hs-identifier hs-var">upats</span></a></span><span>
</span><span id="line-804"></span><span>                              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">eqn_orig :: Origin
</span><a href="GHC.HsToCore.Monad.html#eqn_orig"><span class="hs-identifier hs-var">eqn_orig</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="GHC.Types.Basic.html#FromSource"><span class="hs-identifier hs-var">FromSource</span></a></span><span>
</span><span id="line-805"></span><span>                              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">eqn_rhs :: MatchResult CoreExpr
</span><a href="GHC.HsToCore.Monad.html#eqn_rhs"><span class="hs-identifier hs-var">eqn_rhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681143566"><span class="hs-identifier hs-var">match_result</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-806"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Deltas]
</span><a href="#local-6989586621681143568"><span class="hs-identifier hs-var">rhss_deltas'</span></a></span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-807"></span><span>
</span><span id="line-808"></span><span>    </span><span id="local-6989586621681143589"><span class="annot"><span class="annottext">handleWarnings :: DsM CoreExpr -&gt; DsM CoreExpr
</span><a href="#local-6989586621681143589"><span class="hs-identifier hs-var hs-var">handleWarnings</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Origin -&gt; Bool
</span><a href="GHC.Types.Basic.html#isGenerated"><span class="hs-identifier hs-var">isGenerated</span></a></span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681143610"><span class="hs-identifier hs-var">origin</span></a></span><span>
</span><span id="line-809"></span><span>                     </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">DsM CoreExpr -&gt; DsM CoreExpr
forall a. DsM a -&gt; DsM a
</span><a href="GHC.HsToCore.Monad.html#discardWarningsDs"><span class="hs-identifier hs-var">discardWarningsDs</span></a></span><span>
</span><span id="line-810"></span><span>                     </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">DsM CoreExpr -&gt; DsM CoreExpr
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-811"></span><span>
</span><span id="line-812"></span><span class="annot"><a href="GHC.HsToCore.Match.html#matchEquations"><span class="hs-identifier hs-type">matchEquations</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsMatchContext"><span class="hs-identifier hs-type">HsMatchContext</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>
</span><span id="line-813"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.HsToCore.Match.html#MatchId"><span class="hs-identifier hs-type">MatchId</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-814"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-815"></span><span id="matchEquations"><span class="annot"><span class="annottext">matchEquations :: HsMatchContext GhcRn
-&gt; [Id] -&gt; [EquationInfo] -&gt; Kind -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Match.html#matchEquations"><span class="hs-identifier hs-var hs-var">matchEquations</span></a></span></span><span> </span><span id="local-6989586621681143562"><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681143562"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681143561"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681143561"><span class="hs-identifier hs-var">vars</span></a></span></span><span> </span><span id="local-6989586621681143560"><span class="annot"><span class="annottext">[EquationInfo]
</span><a href="#local-6989586621681143560"><span class="hs-identifier hs-var">eqns_info</span></a></span></span><span> </span><span id="local-6989586621681143559"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143559"><span class="hs-identifier hs-var">rhs_ty</span></a></span></span><span>
</span><span id="line-816"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681143558"><span class="annot"><span class="annottext">error_doc :: SDoc
</span><a href="#local-6989586621681143558"><span class="hs-identifier hs-var hs-var">error_doc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn -&gt; SDoc
forall (p :: Pass).
OutputableBndrId p =&gt;
HsMatchContext (GhcPass p) -&gt; SDoc
</span><a href="GHC.Hs.Expr.html#matchContextErrString"><span class="hs-identifier hs-var">matchContextErrString</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681143562"><span class="hs-identifier hs-var">ctxt</span></a></span><span>
</span><span id="line-817"></span><span>
</span><span id="line-818"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681143556"><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681143556"><span class="hs-identifier hs-var">match_result</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Kind -&gt; [EquationInfo] -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#match"><span class="hs-identifier hs-var">match</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681143561"><span class="hs-identifier hs-var">vars</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143559"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span> </span><span class="annot"><span class="annottext">[EquationInfo]
</span><a href="#local-6989586621681143560"><span class="hs-identifier hs-var">eqns_info</span></a></span><span>
</span><span id="line-819"></span><span>
</span><span id="line-820"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681143555"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681143555"><span class="hs-identifier hs-var">fail_expr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Kind -&gt; SDoc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Utils.html#mkErrorAppDs"><span class="hs-identifier hs-var">mkErrorAppDs</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#pAT_ERROR_ID"><span class="hs-identifier hs-var">pAT_ERROR_ID</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143559"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681143558"><span class="hs-identifier hs-var">error_doc</span></a></span><span>
</span><span id="line-821"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Utils.html#extractMatchResult"><span class="hs-identifier hs-var">extractMatchResult</span></a></span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681143556"><span class="hs-identifier hs-var">match_result</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681143555"><span class="hs-identifier hs-var">fail_expr</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-822"></span><span>
</span><span id="line-823"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection[matchSimply]{@matchSimply@: match a single expression against a single pattern}
*                                                                      *
************************************************************************

@mkSimpleMatch@ is a wrapper for @match@ which deals with the
situation where we want to match a single expression against a single
pattern. It returns an expression.
-}</span><span>
</span><span id="line-834"></span><span>
</span><span id="line-835"></span><span class="annot"><a href="GHC.HsToCore.Match.html#matchSimply"><span class="hs-identifier hs-type">matchSimply</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>                 </span><span class="hs-comment">-- ^ Scrutinee</span><span>
</span><span id="line-836"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsMatchContext"><span class="hs-identifier hs-type">HsMatchContext</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>     </span><span class="hs-comment">-- ^ Match kind</span><span>
</span><span id="line-837"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#LPat"><span class="hs-identifier hs-type">LPat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>               </span><span class="hs-comment">-- ^ Pattern it should match</span><span>
</span><span id="line-838"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>                 </span><span class="hs-comment">-- ^ Return this if it matches</span><span>
</span><span id="line-839"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>                 </span><span class="hs-comment">-- ^ Return this if it doesn't</span><span>
</span><span id="line-840"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-841"></span><span class="hs-comment">-- Do not warn about incomplete patterns; see matchSinglePat comments</span><span>
</span><span id="line-842"></span><span id="matchSimply"><span class="annot"><span class="annottext">matchSimply :: CoreExpr
-&gt; HsMatchContext GhcRn
-&gt; LPat GhcTc
-&gt; CoreExpr
-&gt; CoreExpr
-&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Match.html#matchSimply"><span class="hs-identifier hs-var hs-var">matchSimply</span></a></span></span><span> </span><span id="local-6989586621681143551"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681143551"><span class="hs-identifier hs-var">scrut</span></a></span></span><span> </span><span id="local-6989586621681143550"><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681143550"><span class="hs-identifier hs-var">hs_ctx</span></a></span></span><span> </span><span id="local-6989586621681143549"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681143549"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621681143548"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681143548"><span class="hs-identifier hs-var">result_expr</span></a></span></span><span> </span><span id="local-6989586621681143547"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681143547"><span class="hs-identifier hs-var">fail_expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-843"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-844"></span><span>      </span><span id="local-6989586621681143546"><span class="annot"><span class="annottext">match_result :: MatchResult CoreExpr
</span><a href="#local-6989586621681143546"><span class="hs-identifier hs-var hs-var">match_result</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; MatchResult CoreExpr
</span><a href="GHC.HsToCore.Utils.html#cantFailMatchResult"><span class="hs-identifier hs-var">cantFailMatchResult</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681143548"><span class="hs-identifier hs-var">result_expr</span></a></span><span>
</span><span id="line-845"></span><span>      </span><span id="local-6989586621681143544"><span class="annot"><span class="annottext">rhs_ty :: Kind
</span><a href="#local-6989586621681143544"><span class="hs-identifier hs-var hs-var">rhs_ty</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Kind
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681143547"><span class="hs-identifier hs-var">fail_expr</span></a></span><span>
</span><span id="line-846"></span><span>        </span><span class="hs-comment">-- Use exprType of fail_expr, because won't refine in the case of failure!</span><span>
</span><span id="line-847"></span><span>    </span><span id="local-6989586621681143542"><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681143542"><span class="hs-identifier hs-var">match_result'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CoreExpr
-&gt; HsMatchContext GhcRn
-&gt; LPat GhcTc
-&gt; Kind
-&gt; MatchResult CoreExpr
-&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#matchSinglePat"><span class="hs-identifier hs-var">matchSinglePat</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681143551"><span class="hs-identifier hs-var">scrut</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681143550"><span class="hs-identifier hs-var">hs_ctx</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681143549"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143544"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681143546"><span class="hs-identifier hs-var">match_result</span></a></span><span>
</span><span id="line-848"></span><span>    </span><span class="annot"><span class="annottext">MatchResult CoreExpr -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Utils.html#extractMatchResult"><span class="hs-identifier hs-var">extractMatchResult</span></a></span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681143542"><span class="hs-identifier hs-var">match_result'</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681143547"><span class="hs-identifier hs-var">fail_expr</span></a></span><span>
</span><span id="line-849"></span><span>
</span><span id="line-850"></span><span class="annot"><a href="GHC.HsToCore.Match.html#matchSinglePat"><span class="hs-identifier hs-type">matchSinglePat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsMatchContext"><span class="hs-identifier hs-type">HsMatchContext</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#LPat"><span class="hs-identifier hs-type">LPat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>
</span><span id="line-851"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#MatchResult"><span class="hs-identifier hs-type">MatchResult</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Monad.html#MatchResult"><span class="hs-identifier hs-type">MatchResult</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-852"></span><span class="hs-comment">-- matchSinglePat ensures that the scrutinee is a variable</span><span>
</span><span id="line-853"></span><span class="hs-comment">-- and then calls matchSinglePatVar</span><span>
</span><span id="line-854"></span><span class="hs-comment">--</span><span>
</span><span id="line-855"></span><span class="hs-comment">-- matchSinglePat does not warn about incomplete patterns</span><span>
</span><span id="line-856"></span><span class="hs-comment">-- Used for things like [ e | pat &lt;- stuff ], where</span><span>
</span><span id="line-857"></span><span class="hs-comment">-- incomplete patterns are just fine</span><span>
</span><span id="line-858"></span><span>
</span><span id="line-859"></span><span id="matchSinglePat"><span class="annot"><span class="annottext">matchSinglePat :: CoreExpr
-&gt; HsMatchContext GhcRn
-&gt; LPat GhcTc
-&gt; Kind
-&gt; MatchResult CoreExpr
-&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#matchSinglePat"><span class="hs-identifier hs-var hs-var">matchSinglePat</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span> </span><span id="local-6989586621681143541"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143541"><span class="hs-identifier hs-var">var</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681143540"><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681143540"><span class="hs-identifier hs-var">ctx</span></a></span></span><span> </span><span id="local-6989586621681143539"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681143539"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621681143538"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143538"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681143537"><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681143537"><span class="hs-identifier hs-var">match_result</span></a></span></span><span>
</span><span id="line-860"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="GHC.Types.Name.html#isExternalName"><span class="hs-identifier hs-var">isExternalName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143541"><span class="hs-identifier hs-var">var</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-861"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id
-&gt; HsMatchContext GhcRn
-&gt; LPat GhcTc
-&gt; Kind
-&gt; MatchResult CoreExpr
-&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#matchSinglePatVar"><span class="hs-identifier hs-var">matchSinglePatVar</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143541"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681143540"><span class="hs-identifier hs-var">ctx</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681143539"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143538"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681143537"><span class="hs-identifier hs-var">match_result</span></a></span><span>
</span><span id="line-862"></span><span>
</span><span id="line-863"></span><span class="annot"><a href="GHC.HsToCore.Match.html#matchSinglePat"><span class="hs-identifier hs-var">matchSinglePat</span></a></span><span> </span><span id="local-6989586621681143535"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681143535"><span class="hs-identifier hs-var">scrut</span></a></span></span><span> </span><span id="local-6989586621681143534"><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681143534"><span class="hs-identifier hs-var">hs_ctx</span></a></span></span><span> </span><span id="local-6989586621681143533"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681143533"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621681143532"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143532"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681143531"><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681143531"><span class="hs-identifier hs-var">match_result</span></a></span></span><span>
</span><span id="line-864"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681143530"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143530"><span class="hs-identifier hs-var">var</span></a></span></span><span>           </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Kind -&gt; LPat GhcTc -&gt; DsM Id
</span><a href="GHC.HsToCore.Utils.html#selectSimpleMatchVarL"><span class="hs-identifier hs-var">selectSimpleMatchVarL</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681143533"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-865"></span><span>                            </span><span class="hs-comment">-- matchSinglePat is only used in matchSimply, which</span><span>
</span><span id="line-866"></span><span>                            </span><span class="hs-comment">-- is used in list comprehension, arrow notation,</span><span>
</span><span id="line-867"></span><span>                            </span><span class="hs-comment">-- and to create field selectors. All of which only</span><span>
</span><span id="line-868"></span><span>                            </span><span class="hs-comment">-- bind unrestricted variables, hence the 'Many'</span><span>
</span><span id="line-869"></span><span>                            </span><span class="hs-comment">-- above.</span><span>
</span><span id="line-870"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681143527"><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681143527"><span class="hs-identifier hs-var">match_result'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id
-&gt; HsMatchContext GhcRn
-&gt; LPat GhcTc
-&gt; Kind
-&gt; MatchResult CoreExpr
-&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#matchSinglePatVar"><span class="hs-identifier hs-var">matchSinglePatVar</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143530"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681143534"><span class="hs-identifier hs-var">hs_ctx</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681143533"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143532"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681143531"><span class="hs-identifier hs-var">match_result</span></a></span><span>
</span><span id="line-871"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr -&gt; DsM (MatchResult CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(MatchResult CoreExpr -&gt; DsM (MatchResult CoreExpr))
-&gt; MatchResult CoreExpr -&gt; DsM (MatchResult CoreExpr)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; DsWrapper
</span><a href="GHC.Core.Utils.html#bindNonRec"><span class="hs-identifier hs-var">bindNonRec</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143530"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681143535"><span class="hs-identifier hs-var">scrut</span></a></span><span> </span><span class="annot"><span class="annottext">DsWrapper -&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681143527"><span class="hs-identifier hs-var">match_result'</span></a></span><span>
</span><span id="line-872"></span><span>       </span><span class="hs-special">}</span><span>
</span><span id="line-873"></span><span>
</span><span id="line-874"></span><span class="annot"><a href="GHC.HsToCore.Match.html#matchSinglePatVar"><span class="hs-identifier hs-type">matchSinglePatVar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>   </span><span class="hs-comment">-- See Note [Match Ids]</span><span>
</span><span id="line-875"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsMatchContext"><span class="hs-identifier hs-type">HsMatchContext</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#LPat"><span class="hs-identifier hs-type">LPat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>
</span><span id="line-876"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#MatchResult"><span class="hs-identifier hs-type">MatchResult</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Monad.html#MatchResult"><span class="hs-identifier hs-type">MatchResult</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-877"></span><span id="matchSinglePatVar"><span class="annot"><span class="annottext">matchSinglePatVar :: Id
-&gt; HsMatchContext GhcRn
-&gt; LPat GhcTc
-&gt; Kind
-&gt; MatchResult CoreExpr
-&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#matchSinglePatVar"><span class="hs-identifier hs-var hs-var">matchSinglePatVar</span></a></span></span><span> </span><span id="local-6989586621681143525"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143525"><span class="hs-identifier hs-var">var</span></a></span></span><span> </span><span id="local-6989586621681143524"><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681143524"><span class="hs-identifier hs-var">ctx</span></a></span></span><span> </span><span id="local-6989586621681143523"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681143523"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621681143522"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143522"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681143521"><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681143521"><span class="hs-identifier hs-var">match_result</span></a></span></span><span>
</span><span id="line-878"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT2</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">isInternalName</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">idName</span><span> </span><span class="hs-identifier">var</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">var</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-879"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681143520"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681143520"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env DsGblEnv DsLclEnv) DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-880"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681143519"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681143519"><span class="hs-identifier hs-var">locn</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DsM SrcSpan
</span><a href="GHC.HsToCore.Monad.html#getSrcSpanDs"><span class="hs-identifier hs-var">getSrcSpanDs</span></a></span><span>
</span><span id="line-881"></span><span>
</span><span id="line-882"></span><span>       </span><span class="hs-comment">-- Pattern match check warnings</span><span>
</span><span id="line-883"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Origin -&gt; HsMatchContext GhcRn -&gt; Bool
forall id. DynFlags -&gt; Origin -&gt; HsMatchContext id -&gt; Bool
</span><a href="GHC.HsToCore.PmCheck.html#isMatchContextPmChecked"><span class="hs-identifier hs-var">isMatchContextPmChecked</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681143520"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="GHC.Types.Basic.html#FromSource"><span class="hs-identifier hs-var">FromSource</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681143524"><span class="hs-identifier hs-var">ctx</span></a></span><span>
</span><span id="line-884"></span><span>            </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; DsMatchContext -&gt; Id -&gt; Pat GhcTc -&gt; TcRnIf DsGblEnv DsLclEnv ()
</span><a href="GHC.HsToCore.PmCheck.html#checkSingle"><span class="hs-identifier hs-var">checkSingle</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681143520"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsMatchContext GhcRn -&gt; SrcSpan -&gt; DsMatchContext
</span><a href="GHC.HsToCore.Monad.html#DsMatchContext"><span class="hs-identifier hs-var">DsMatchContext</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681143524"><span class="hs-identifier hs-var">ctx</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681143519"><span class="hs-identifier hs-var">locn</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143525"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc) -&gt; Pat GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681143523"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-885"></span><span>            </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">() -&gt; TcRnIf DsGblEnv DsLclEnv ()
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-886"></span><span>
</span><span id="line-887"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681143517"><span class="annot"><span class="annottext">eqn_info :: EquationInfo
</span><a href="#local-6989586621681143517"><span class="hs-identifier hs-var hs-var">eqn_info</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">EqnInfo :: [Pat GhcTc] -&gt; Origin -&gt; MatchResult CoreExpr -&gt; EquationInfo
</span><a href="GHC.HsToCore.Monad.html#EqnInfo"><span class="hs-identifier hs-type">EqnInfo</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">eqn_pats :: [Pat GhcTc]
</span><a href="GHC.HsToCore.Monad.html#eqn_pats"><span class="hs-identifier hs-var">eqn_pats</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc) -&gt; Pat GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; LPat GhcTc -&gt; LPat GhcTc
</span><a href="GHC.HsToCore.Utils.html#decideBangHood"><span class="hs-identifier hs-var">decideBangHood</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681143520"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681143523"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-888"></span><span>                                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">eqn_orig :: Origin
</span><a href="GHC.HsToCore.Monad.html#eqn_orig"><span class="hs-identifier hs-var">eqn_orig</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="GHC.Types.Basic.html#FromSource"><span class="hs-identifier hs-var">FromSource</span></a></span><span>
</span><span id="line-889"></span><span>                                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">eqn_rhs :: MatchResult CoreExpr
</span><a href="GHC.HsToCore.Monad.html#eqn_rhs"><span class="hs-identifier hs-var">eqn_rhs</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681143521"><span class="hs-identifier hs-var">match_result</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-890"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Kind -&gt; [EquationInfo] -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#match"><span class="hs-identifier hs-var">match</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Item [Id]
Id
</span><a href="#local-6989586621681143525"><span class="hs-identifier hs-var">var</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143522"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Item [EquationInfo]
EquationInfo
</span><a href="#local-6989586621681143517"><span class="hs-identifier hs-var">eqn_info</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-891"></span><span>
</span><span id="line-892"></span><span>
</span><span id="line-893"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                Pattern classification
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-900"></span><span>
</span><span id="line-901"></span><span class="hs-keyword">data</span><span> </span><span id="PatGroup"><span class="annot"><a href="GHC.HsToCore.Match.html#PatGroup"><span class="hs-identifier hs-var">PatGroup</span></a></span></span><span>
</span><span id="line-902"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="PgAny"><span class="annot"><a href="GHC.HsToCore.Match.html#PgAny"><span class="hs-identifier hs-var">PgAny</span></a></span></span><span>               </span><span class="hs-comment">-- Immediate match: variables, wildcards,</span><span>
</span><span id="line-903"></span><span>                        </span><span class="hs-comment">--                  lazy patterns</span><span>
</span><span id="line-904"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="PgCon"><span class="annot"><a href="GHC.HsToCore.Match.html#PgCon"><span class="hs-identifier hs-var">PgCon</span></a></span></span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span>       </span><span class="hs-comment">-- Constructor patterns (incl list, tuple)</span><span>
</span><span id="line-905"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="PgSyn"><span class="annot"><a href="GHC.HsToCore.Match.html#PgSyn"><span class="hs-identifier hs-var">PgSyn</span></a></span></span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- See Note [Pattern synonym groups]</span><span>
</span><span id="line-906"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="PgLit"><span class="annot"><a href="GHC.HsToCore.Match.html#PgLit"><span class="hs-identifier hs-var">PgLit</span></a></span></span><span> </span><span class="annot"><a href="GHC.Types.Literal.html#Literal"><span class="hs-identifier hs-type">Literal</span></a></span><span>       </span><span class="hs-comment">-- Literal patterns</span><span>
</span><span id="line-907"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="PgN"><span class="annot"><a href="GHC.HsToCore.Match.html#PgN"><span class="hs-identifier hs-var">PgN</span></a></span></span><span>   </span><span class="annot"><a href="../../base/src/GHC.Real.html#Rational"><span class="hs-identifier hs-type">Rational</span></a></span><span>      </span><span class="hs-comment">-- Overloaded numeric literals;</span><span>
</span><span id="line-908"></span><span>                        </span><span class="hs-comment">-- see Note [Don't use Literal for PgN]</span><span>
</span><span id="line-909"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="PgOverS"><span class="annot"><a href="GHC.HsToCore.Match.html#PgOverS"><span class="hs-identifier hs-var">PgOverS</span></a></span></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span>  </span><span class="hs-comment">-- Overloaded string literals</span><span>
</span><span id="line-910"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="PgNpK"><span class="annot"><a href="GHC.HsToCore.Match.html#PgNpK"><span class="hs-identifier hs-var">PgNpK</span></a></span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span>       </span><span class="hs-comment">-- n+k patterns</span><span>
</span><span id="line-911"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="PgBang"><span class="annot"><a href="GHC.HsToCore.Match.html#PgBang"><span class="hs-identifier hs-var">PgBang</span></a></span></span><span>              </span><span class="hs-comment">-- Bang patterns</span><span>
</span><span id="line-912"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="PgCo"><span class="annot"><a href="GHC.HsToCore.Match.html#PgCo"><span class="hs-identifier hs-var">PgCo</span></a></span></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>           </span><span class="hs-comment">-- Coercion patterns; the type is the type</span><span>
</span><span id="line-913"></span><span>                        </span><span class="hs-comment">--      of the pattern *inside*</span><span>
</span><span id="line-914"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="PgView"><span class="annot"><a href="GHC.HsToCore.Match.html#PgView"><span class="hs-identifier hs-var">PgView</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- view pattern (e -&gt; p):</span><span>
</span><span id="line-915"></span><span>                        </span><span class="hs-comment">-- the LHsExpr is the expression e</span><span>
</span><span id="line-916"></span><span>           </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>         </span><span class="hs-comment">-- the Type is the type of p (equivalently, the result type of e)</span><span>
</span><span id="line-917"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="PgOverloadedList"><span class="annot"><a href="GHC.HsToCore.Match.html#PgOverloadedList"><span class="hs-identifier hs-var">PgOverloadedList</span></a></span></span><span>
</span><span id="line-918"></span><span>
</span><span id="line-919"></span><span class="hs-comment">{- Note [Don't use Literal for PgN]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Previously we had, as PatGroup constructors

  | ...
  | PgN   Literal       -- Overloaded literals
  | PgNpK Literal       -- n+k patterns
  | ...

But Literal is really supposed to represent an *unboxed* literal, like Int#.
We were sticking the literal from, say, an overloaded numeric literal pattern
into a LitInt constructor. This didn't really make sense; and we now have
the invariant that value in a LitInt must be in the range of the target
machine's Int# type, and an overloaded literal could meaningfully be larger.

Solution: For pattern grouping purposes, just store the literal directly in
the PgN constructor as a Rational if numeric, and add a PgOverStr constructor
for overloaded strings.
-}</span><span>
</span><span id="line-938"></span><span>
</span><span id="line-939"></span><span class="annot"><a href="GHC.HsToCore.Match.html#groupEquations"><span class="hs-identifier hs-type">groupEquations</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Match.html#PatGroup"><span class="hs-identifier hs-type">PatGroup</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-940"></span><span class="hs-comment">-- If the result is of form [g1, g2, g3],</span><span>
</span><span id="line-941"></span><span class="hs-comment">-- (a) all the (pg,eq) pairs in g1 have the same pg</span><span>
</span><span id="line-942"></span><span class="hs-comment">-- (b) none of the gi are empty</span><span>
</span><span id="line-943"></span><span class="hs-comment">-- The ordering of equations is unchanged</span><span>
</span><span id="line-944"></span><span id="groupEquations"><span class="annot"><span class="annottext">groupEquations :: Platform -&gt; [EquationInfo] -&gt; [NonEmpty (PatGroup, EquationInfo)]
</span><a href="GHC.HsToCore.Match.html#groupEquations"><span class="hs-identifier hs-var hs-var">groupEquations</span></a></span></span><span> </span><span id="local-6989586621681143516"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681143516"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span id="local-6989586621681143515"><span class="annot"><span class="annottext">[EquationInfo]
</span><a href="#local-6989586621681143515"><span class="hs-identifier hs-var">eqns</span></a></span></span><span>
</span><span id="line-945"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((PatGroup, EquationInfo) -&gt; (PatGroup, EquationInfo) -&gt; Bool)
-&gt; [(PatGroup, EquationInfo)]
-&gt; [NonEmpty (PatGroup, EquationInfo)]
forall (f :: * -&gt; *) a.
Foldable f =&gt;
(a -&gt; a -&gt; Bool) -&gt; f a -&gt; [NonEmpty a]
</span><a href="../../base/src/Data.List.NonEmpty.html#groupBy"><span class="hs-identifier hs-var">NEL.groupBy</span></a></span><span> </span><span class="annot"><span class="annottext">(PatGroup, EquationInfo) -&gt; (PatGroup, EquationInfo) -&gt; Bool
</span><a href="#local-6989586621681143513"><span class="hs-identifier hs-var">same_gp</span></a></span><span> </span><span class="annot"><span class="annottext">([(PatGroup, EquationInfo)] -&gt; [NonEmpty (PatGroup, EquationInfo)])
-&gt; [(PatGroup, EquationInfo)]
-&gt; [NonEmpty (PatGroup, EquationInfo)]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; Pat GhcTc -&gt; PatGroup
</span><a href="GHC.HsToCore.Match.html#patGroup"><span class="hs-identifier hs-var">patGroup</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681143516"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EquationInfo -&gt; Pat GhcTc
</span><a href="GHC.HsToCore.Utils.html#firstPat"><span class="hs-identifier hs-var">firstPat</span></a></span><span> </span><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681143511"><span class="hs-identifier hs-var">eqn</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681143511"><span class="hs-identifier hs-var">eqn</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681143511"><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681143511"><span class="hs-identifier hs-var">eqn</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[EquationInfo]
</span><a href="#local-6989586621681143515"><span class="hs-identifier hs-var">eqns</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-946"></span><span>  </span><span class="hs-comment">-- comprehension on NonEmpty</span><span>
</span><span id="line-947"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-948"></span><span>    </span><span class="annot"><a href="#local-6989586621681143513"><span class="hs-identifier hs-type">same_gp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Match.html#PatGroup"><span class="hs-identifier hs-type">PatGroup</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Match.html#PatGroup"><span class="hs-identifier hs-type">PatGroup</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-949"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681143510"><span class="annot"><span class="annottext">PatGroup
</span><a href="#local-6989586621681143510"><span class="hs-identifier hs-var">pg1</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">EquationInfo
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681143513"><span class="annot"><span class="annottext">same_gp :: (PatGroup, EquationInfo) -&gt; (PatGroup, EquationInfo) -&gt; Bool
</span><a href="#local-6989586621681143513"><span class="hs-operator hs-var hs-var">`same_gp`</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681143509"><span class="annot"><span class="annottext">PatGroup
</span><a href="#local-6989586621681143509"><span class="hs-identifier hs-var">pg2</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">EquationInfo
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PatGroup
</span><a href="#local-6989586621681143510"><span class="hs-identifier hs-var">pg1</span></a></span><span> </span><span class="annot"><span class="annottext">PatGroup -&gt; PatGroup -&gt; Bool
</span><a href="GHC.HsToCore.Match.html#sameGroup"><span class="hs-operator hs-var">`sameGroup`</span></a></span><span> </span><span class="annot"><span class="annottext">PatGroup
</span><a href="#local-6989586621681143509"><span class="hs-identifier hs-var">pg2</span></a></span><span>
</span><span id="line-950"></span><span>
</span><span id="line-951"></span><span class="hs-comment">-- TODO Make subGroup1 using a NonEmptyMap</span><span>
</span><span id="line-952"></span><span id="local-6989586621681144333"><span id="local-6989586621681144334"><span class="annot"><a href="GHC.HsToCore.Match.html#subGroup"><span class="hs-identifier hs-type">subGroup</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681144334"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- Map.elems</span><span>
</span><span id="line-953"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681144334"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-comment">-- Map.empty</span><span>
</span><span id="line-954"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681144333"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681144334"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- Map.lookup</span><span>
</span><span id="line-955"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681144333"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681144334"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681144334"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- Map.insert</span><span>
</span><span id="line-956"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681144333"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span class="hs-special">]</span></span></span><span>
</span><span id="line-957"></span><span class="hs-comment">-- Input is a particular group.  The result sub-groups the</span><span>
</span><span id="line-958"></span><span class="hs-comment">-- equations by with particular constructor, literal etc they match.</span><span>
</span><span id="line-959"></span><span class="hs-comment">-- Each sub-list in the result has the same PatGroup</span><span>
</span><span id="line-960"></span><span class="hs-comment">-- See Note [Take care with pattern order]</span><span>
</span><span id="line-961"></span><span class="hs-comment">-- Parameterized by map operations to allow different implementations</span><span>
</span><span id="line-962"></span><span class="hs-comment">-- and constraints, eg. types without Ord instance.</span><span>
</span><span id="line-963"></span><span id="subGroup"><span class="annot"><span class="annottext">subGroup :: forall m a.
(m -&gt; [NonEmpty EquationInfo])
-&gt; m
-&gt; (a -&gt; m -&gt; Maybe (NonEmpty EquationInfo))
-&gt; (a -&gt; NonEmpty EquationInfo -&gt; m -&gt; m)
-&gt; [(a, EquationInfo)]
-&gt; [NonEmpty EquationInfo]
</span><a href="GHC.HsToCore.Match.html#subGroup"><span class="hs-identifier hs-var hs-var">subGroup</span></a></span></span><span> </span><span id="local-6989586621681143502"><span class="annot"><span class="annottext">m -&gt; [NonEmpty EquationInfo]
</span><a href="#local-6989586621681143502"><span class="hs-identifier hs-var">elems</span></a></span></span><span> </span><span id="local-6989586621681143501"><span class="annot"><span class="annottext">m
</span><a href="#local-6989586621681143501"><span class="hs-identifier hs-var">empty</span></a></span></span><span> </span><span id="local-6989586621681143500"><span class="annot"><span class="annottext">a -&gt; m -&gt; Maybe (NonEmpty EquationInfo)
</span><a href="#local-6989586621681143500"><span class="hs-identifier hs-var">lookup</span></a></span></span><span> </span><span id="local-6989586621681143499"><span class="annot"><span class="annottext">a -&gt; NonEmpty EquationInfo -&gt; m -&gt; m
</span><a href="#local-6989586621681143499"><span class="hs-identifier hs-var">insert</span></a></span></span><span> </span><span id="local-6989586621681143498"><span class="annot"><span class="annottext">[(a, EquationInfo)]
</span><a href="#local-6989586621681143498"><span class="hs-identifier hs-var">group</span></a></span></span><span>
</span><span id="line-964"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(NonEmpty EquationInfo -&gt; NonEmpty EquationInfo)
-&gt; [NonEmpty EquationInfo] -&gt; [NonEmpty EquationInfo]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty EquationInfo -&gt; NonEmpty EquationInfo
forall a. NonEmpty a -&gt; NonEmpty a
</span><a href="../../base/src/Data.List.NonEmpty.html#reverse"><span class="hs-identifier hs-var">NEL.reverse</span></a></span><span> </span><span class="annot"><span class="annottext">([NonEmpty EquationInfo] -&gt; [NonEmpty EquationInfo])
-&gt; [NonEmpty EquationInfo] -&gt; [NonEmpty EquationInfo]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">m -&gt; [NonEmpty EquationInfo]
</span><a href="#local-6989586621681143502"><span class="hs-identifier hs-var">elems</span></a></span><span> </span><span class="annot"><span class="annottext">(m -&gt; [NonEmpty EquationInfo]) -&gt; m -&gt; [NonEmpty EquationInfo]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(m -&gt; (a, EquationInfo) -&gt; m) -&gt; m -&gt; [(a, EquationInfo)] -&gt; m
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="annot"><span class="annottext">m -&gt; (a, EquationInfo) -&gt; m
</span><a href="#local-6989586621681143495"><span class="hs-identifier hs-var">accumulate</span></a></span><span> </span><span class="annot"><span class="annottext">m
</span><a href="#local-6989586621681143501"><span class="hs-identifier hs-var">empty</span></a></span><span> </span><span class="annot"><span class="annottext">[(a, EquationInfo)]
</span><a href="#local-6989586621681143498"><span class="hs-identifier hs-var">group</span></a></span><span>
</span><span id="line-965"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-966"></span><span>    </span><span id="local-6989586621681143495"><span class="annot"><span class="annottext">accumulate :: m -&gt; (a, EquationInfo) -&gt; m
</span><a href="#local-6989586621681143495"><span class="hs-identifier hs-var hs-var">accumulate</span></a></span></span><span> </span><span id="local-6989586621681143494"><span class="annot"><span class="annottext">m
</span><a href="#local-6989586621681143494"><span class="hs-identifier hs-var">pg_map</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681143493"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681143493"><span class="hs-identifier hs-var">pg</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681143492"><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681143492"><span class="hs-identifier hs-var">eqn</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-967"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">a -&gt; m -&gt; Maybe (NonEmpty EquationInfo)
</span><a href="#local-6989586621681143500"><span class="hs-identifier hs-var">lookup</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681143493"><span class="hs-identifier hs-var">pg</span></a></span><span> </span><span class="annot"><span class="annottext">m
</span><a href="#local-6989586621681143494"><span class="hs-identifier hs-var">pg_map</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-968"></span><span>          </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681143491"><span class="annot"><span class="annottext">NonEmpty EquationInfo
</span><a href="#local-6989586621681143491"><span class="hs-identifier hs-var">eqns</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a -&gt; NonEmpty EquationInfo -&gt; m -&gt; m
</span><a href="#local-6989586621681143499"><span class="hs-identifier hs-var">insert</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681143493"><span class="hs-identifier hs-var">pg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EquationInfo -&gt; NonEmpty EquationInfo -&gt; NonEmpty EquationInfo
forall a. a -&gt; NonEmpty a -&gt; NonEmpty a
</span><a href="../../base/src/Data.List.NonEmpty.html#cons"><span class="hs-identifier hs-var">NEL.cons</span></a></span><span> </span><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681143492"><span class="hs-identifier hs-var">eqn</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty EquationInfo
</span><a href="#local-6989586621681143491"><span class="hs-identifier hs-var">eqns</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">m
</span><a href="#local-6989586621681143494"><span class="hs-identifier hs-var">pg_map</span></a></span><span>
</span><span id="line-969"></span><span>          </span><span class="annot"><span class="annottext">Maybe (NonEmpty EquationInfo)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a -&gt; NonEmpty EquationInfo -&gt; m -&gt; m
</span><a href="#local-6989586621681143499"><span class="hs-identifier hs-var">insert</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681143493"><span class="hs-identifier hs-var">pg</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Item (NonEmpty EquationInfo)
EquationInfo
</span><a href="#local-6989586621681143492"><span class="hs-identifier hs-var">eqn</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">m
</span><a href="#local-6989586621681143494"><span class="hs-identifier hs-var">pg_map</span></a></span><span>
</span><span id="line-970"></span><span>    </span><span class="hs-comment">-- pg_map :: Map a [EquationInfo]</span><span>
</span><span id="line-971"></span><span>    </span><span class="hs-comment">-- Equations seen so far in reverse order of appearance</span><span>
</span><span id="line-972"></span><span>
</span><span id="line-973"></span><span id="local-6989586621681144456"><span class="annot"><a href="GHC.HsToCore.Match.html#subGroupOrd"><span class="hs-identifier hs-type">subGroupOrd</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Ord</span></span><span> </span><span class="annot"><a href="#local-6989586621681144456"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681144456"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-974"></span><span id="subGroupOrd"><span class="annot"><span class="annottext">subGroupOrd :: forall a. Ord a =&gt; [(a, EquationInfo)] -&gt; [NonEmpty EquationInfo]
</span><a href="GHC.HsToCore.Match.html#subGroupOrd"><span class="hs-identifier hs-var hs-var">subGroupOrd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Map a (NonEmpty EquationInfo) -&gt; [NonEmpty EquationInfo])
-&gt; Map a (NonEmpty EquationInfo)
-&gt; (a
    -&gt; Map a (NonEmpty EquationInfo) -&gt; Maybe (NonEmpty EquationInfo))
-&gt; (a
    -&gt; NonEmpty EquationInfo
    -&gt; Map a (NonEmpty EquationInfo)
    -&gt; Map a (NonEmpty EquationInfo))
-&gt; [(a, EquationInfo)]
-&gt; [NonEmpty EquationInfo]
forall m a.
(m -&gt; [NonEmpty EquationInfo])
-&gt; m
-&gt; (a -&gt; m -&gt; Maybe (NonEmpty EquationInfo))
-&gt; (a -&gt; NonEmpty EquationInfo -&gt; m -&gt; m)
-&gt; [(a, EquationInfo)]
-&gt; [NonEmpty EquationInfo]
</span><a href="GHC.HsToCore.Match.html#subGroup"><span class="hs-identifier hs-var">subGroup</span></a></span><span> </span><span class="annot"><span class="annottext">Map a (NonEmpty EquationInfo) -&gt; [NonEmpty EquationInfo]
forall k a. Map k a -&gt; [a]
</span><a href="../../containers/src/Data.Map.Internal.html#elems"><span class="hs-identifier hs-var">Map.elems</span></a></span><span> </span><span class="annot"><span class="annottext">Map a (NonEmpty EquationInfo)
forall k a. Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#empty"><span class="hs-identifier hs-var">Map.empty</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; Map a (NonEmpty EquationInfo) -&gt; Maybe (NonEmpty EquationInfo)
forall k a. Ord k =&gt; k -&gt; Map k a -&gt; Maybe a
</span><a href="../../containers/src/Data.Map.Internal.html#lookup"><span class="hs-identifier hs-var">Map.lookup</span></a></span><span> </span><span class="annot"><span class="annottext">a
-&gt; NonEmpty EquationInfo
-&gt; Map a (NonEmpty EquationInfo)
-&gt; Map a (NonEmpty EquationInfo)
forall k a. Ord k =&gt; k -&gt; a -&gt; Map k a -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#insert"><span class="hs-identifier hs-var">Map.insert</span></a></span><span>
</span><span id="line-975"></span><span>
</span><span id="line-976"></span><span id="local-6989586621681144457"><span class="annot"><a href="GHC.HsToCore.Match.html#subGroupUniq"><span class="hs-identifier hs-type">subGroupUniq</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Uniquable"><span class="hs-identifier hs-type">Uniquable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681144457"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681144457"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-977"></span><span id="subGroupUniq"><span class="annot"><span class="annottext">subGroupUniq :: forall a.
Uniquable a =&gt;
[(a, EquationInfo)] -&gt; [NonEmpty EquationInfo]
</span><a href="GHC.HsToCore.Match.html#subGroupUniq"><span class="hs-identifier hs-var hs-var">subGroupUniq</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-978"></span><span>  </span><span class="annot"><span class="annottext">(UniqDFM a (NonEmpty EquationInfo) -&gt; [NonEmpty EquationInfo])
-&gt; UniqDFM a (NonEmpty EquationInfo)
-&gt; (a
    -&gt; UniqDFM a (NonEmpty EquationInfo)
    -&gt; Maybe (NonEmpty EquationInfo))
-&gt; (a
    -&gt; NonEmpty EquationInfo
    -&gt; UniqDFM a (NonEmpty EquationInfo)
    -&gt; UniqDFM a (NonEmpty EquationInfo))
-&gt; [(a, EquationInfo)]
-&gt; [NonEmpty EquationInfo]
forall m a.
(m -&gt; [NonEmpty EquationInfo])
-&gt; m
-&gt; (a -&gt; m -&gt; Maybe (NonEmpty EquationInfo))
-&gt; (a -&gt; NonEmpty EquationInfo -&gt; m -&gt; m)
-&gt; [(a, EquationInfo)]
-&gt; [NonEmpty EquationInfo]
</span><a href="GHC.HsToCore.Match.html#subGroup"><span class="hs-identifier hs-var">subGroup</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM a (NonEmpty EquationInfo) -&gt; [NonEmpty EquationInfo]
forall key elt. UniqDFM key elt -&gt; [elt]
</span><a href="GHC.Types.Unique.DFM.html#eltsUDFM"><span class="hs-identifier hs-var">eltsUDFM</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM a (NonEmpty EquationInfo)
forall key elt. UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#emptyUDFM"><span class="hs-identifier hs-var">emptyUDFM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(UniqDFM a (NonEmpty EquationInfo)
 -&gt; a -&gt; Maybe (NonEmpty EquationInfo))
-&gt; a
-&gt; UniqDFM a (NonEmpty EquationInfo)
-&gt; Maybe (NonEmpty EquationInfo)
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM a (NonEmpty EquationInfo)
-&gt; a -&gt; Maybe (NonEmpty EquationInfo)
forall key elt.
Uniquable key =&gt;
UniqDFM key elt -&gt; key -&gt; Maybe elt
</span><a href="GHC.Types.Unique.DFM.html#lookupUDFM"><span class="hs-identifier hs-var">lookupUDFM</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681143475"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681143475"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621681143474"><span class="annot"><span class="annottext">NonEmpty EquationInfo
</span><a href="#local-6989586621681143474"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621681143473"><span class="annot"><span class="annottext">UniqDFM a (NonEmpty EquationInfo)
</span><a href="#local-6989586621681143473"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">UniqDFM a (NonEmpty EquationInfo)
-&gt; a -&gt; NonEmpty EquationInfo -&gt; UniqDFM a (NonEmpty EquationInfo)
forall key elt.
Uniquable key =&gt;
UniqDFM key elt -&gt; key -&gt; elt -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#addToUDFM"><span class="hs-identifier hs-var">addToUDFM</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM a (NonEmpty EquationInfo)
</span><a href="#local-6989586621681143473"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681143475"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty EquationInfo
</span><a href="#local-6989586621681143474"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-979"></span><span>
</span><span id="line-980"></span><span class="hs-comment">{- Note [Pattern synonym groups]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If we see
  f (P a) = e1
  f (P b) = e2
    ...
where P is a pattern synonym, can we put (P a -&gt; e1) and (P b -&gt; e2) in the
same group?  We can if P is a constructor, but /not/ if P is a pattern synonym.
Consider (#11224)
   -- readMaybe :: Read a =&gt; String -&gt; Maybe a
   pattern PRead :: Read a =&gt; () =&gt; a -&gt; String
   pattern PRead a &lt;- (readMaybe -&gt; Just a)

   f (PRead (x::Int))  = e1
   f (PRead (y::Bool)) = e2
This is all fine: we match the string by trying to read an Int; if that
fails we try to read a Bool. But clearly we can't combine the two into a single
match.

Conclusion: we can combine when we invoke PRead /at the same type/.  Hence
in PgSyn we record the instantiating types, and use them in sameGroup.

Note [Take care with pattern order]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In the subGroup function we must be very careful about pattern re-ordering,
Consider the patterns [ (True, Nothing), (False, x), (True, y) ]
Then in bringing together the patterns for True, we must not
swap the Nothing and y!
-}</span><span>
</span><span id="line-1009"></span><span>
</span><span id="line-1010"></span><span class="annot"><a href="GHC.HsToCore.Match.html#sameGroup"><span class="hs-identifier hs-type">sameGroup</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.html#PatGroup"><span class="hs-identifier hs-type">PatGroup</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.html#PatGroup"><span class="hs-identifier hs-type">PatGroup</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1011"></span><span class="hs-comment">-- Same group means that a single case expression</span><span>
</span><span id="line-1012"></span><span class="hs-comment">-- or test will suffice to match both, *and* the order</span><span>
</span><span id="line-1013"></span><span class="hs-comment">-- of testing within the group is insignificant.</span><span>
</span><span id="line-1014"></span><span id="sameGroup"><span class="annot"><span class="annottext">sameGroup :: PatGroup -&gt; PatGroup -&gt; Bool
</span><a href="GHC.HsToCore.Match.html#sameGroup"><span class="hs-identifier hs-var hs-var">sameGroup</span></a></span></span><span> </span><span class="annot"><span class="annottext">PatGroup
</span><a href="GHC.HsToCore.Match.html#PgAny"><span class="hs-identifier hs-var">PgAny</span></a></span><span>         </span><span class="annot"><span class="annottext">PatGroup
</span><a href="GHC.HsToCore.Match.html#PgAny"><span class="hs-identifier hs-var">PgAny</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1015"></span><span class="annot"><a href="GHC.HsToCore.Match.html#sameGroup"><span class="hs-identifier hs-var">sameGroup</span></a></span><span> </span><span class="annot"><span class="annottext">PatGroup
</span><a href="GHC.HsToCore.Match.html#PgBang"><span class="hs-identifier hs-var">PgBang</span></a></span><span>        </span><span class="annot"><span class="annottext">PatGroup
</span><a href="GHC.HsToCore.Match.html#PgBang"><span class="hs-identifier hs-var">PgBang</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1016"></span><span class="annot"><a href="GHC.HsToCore.Match.html#sameGroup"><span class="hs-identifier hs-var">sameGroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Match.html#PgCon"><span class="hs-identifier hs-type">PgCon</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Match.html#PgCon"><span class="hs-identifier hs-type">PgCon</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>    </span><span class="hs-comment">-- One case expression</span><span>
</span><span id="line-1017"></span><span class="annot"><a href="GHC.HsToCore.Match.html#sameGroup"><span class="hs-identifier hs-var">sameGroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Match.html#PgSyn"><span class="hs-identifier hs-type">PgSyn</span></a></span><span> </span><span id="local-6989586621681143471"><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621681143471"><span class="hs-identifier hs-var">p1</span></a></span></span><span> </span><span id="local-6989586621681143470"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681143470"><span class="hs-identifier hs-var">t1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Match.html#PgSyn"><span class="hs-identifier hs-type">PgSyn</span></a></span><span> </span><span id="local-6989586621681143469"><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621681143469"><span class="hs-identifier hs-var">p2</span></a></span></span><span> </span><span id="local-6989586621681143468"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681143468"><span class="hs-identifier hs-var">t2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621681143471"><span class="hs-identifier hs-var">p1</span></a></span><span class="annot"><span class="annottext">PatSyn -&gt; PatSyn -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621681143469"><span class="hs-identifier hs-var">p2</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">[Kind] -&gt; [Kind] -&gt; Bool
</span><a href="GHC.Core.Type.html#eqTypes"><span class="hs-identifier hs-var">eqTypes</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681143470"><span class="hs-identifier hs-var">t1</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681143468"><span class="hs-identifier hs-var">t2</span></a></span><span>
</span><span id="line-1018"></span><span>                                                </span><span class="hs-comment">-- eqTypes: See Note [Pattern synonym groups]</span><span>
</span><span id="line-1019"></span><span class="annot"><a href="GHC.HsToCore.Match.html#sameGroup"><span class="hs-identifier hs-var">sameGroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Match.html#PgLit"><span class="hs-identifier hs-type">PgLit</span></a></span><span> </span><span class="annot"><span class="annottext">Literal
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Match.html#PgLit"><span class="hs-identifier hs-type">PgLit</span></a></span><span> </span><span class="annot"><span class="annottext">Literal
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>    </span><span class="hs-comment">-- One case expression</span><span>
</span><span id="line-1020"></span><span class="annot"><a href="GHC.HsToCore.Match.html#sameGroup"><span class="hs-identifier hs-var">sameGroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Match.html#PgN"><span class="hs-identifier hs-type">PgN</span></a></span><span> </span><span id="local-6989586621681143466"><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621681143466"><span class="hs-identifier hs-var">l1</span></a></span></span><span class="hs-special">)</span><span>      </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Match.html#PgN"><span class="hs-identifier hs-type">PgN</span></a></span><span> </span><span id="local-6989586621681143465"><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621681143465"><span class="hs-identifier hs-var">l2</span></a></span></span><span class="hs-special">)</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621681143466"><span class="hs-identifier hs-var">l1</span></a></span><span class="annot"><span class="annottext">Rational -&gt; Rational -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621681143465"><span class="hs-identifier hs-var">l2</span></a></span><span>  </span><span class="hs-comment">-- Order is significant</span><span>
</span><span id="line-1021"></span><span class="annot"><a href="GHC.HsToCore.Match.html#sameGroup"><span class="hs-identifier hs-var">sameGroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Match.html#PgOverS"><span class="hs-identifier hs-type">PgOverS</span></a></span><span> </span><span id="local-6989586621681143464"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681143464"><span class="hs-identifier hs-var">s1</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Match.html#PgOverS"><span class="hs-identifier hs-type">PgOverS</span></a></span><span> </span><span id="local-6989586621681143463"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681143463"><span class="hs-identifier hs-var">s2</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681143464"><span class="hs-identifier hs-var">s1</span></a></span><span class="annot"><span class="annottext">FastString -&gt; FastString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681143463"><span class="hs-identifier hs-var">s2</span></a></span><span>
</span><span id="line-1022"></span><span class="annot"><a href="GHC.HsToCore.Match.html#sameGroup"><span class="hs-identifier hs-var">sameGroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Match.html#PgNpK"><span class="hs-identifier hs-type">PgNpK</span></a></span><span> </span><span id="local-6989586621681143462"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681143462"><span class="hs-identifier hs-var">l1</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Match.html#PgNpK"><span class="hs-identifier hs-type">PgNpK</span></a></span><span> </span><span id="local-6989586621681143461"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681143461"><span class="hs-identifier hs-var">l2</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681143462"><span class="hs-identifier hs-var">l1</span></a></span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681143461"><span class="hs-identifier hs-var">l2</span></a></span><span>  </span><span class="hs-comment">-- See Note [Grouping overloaded literal patterns]</span><span>
</span><span id="line-1023"></span><span class="annot"><a href="GHC.HsToCore.Match.html#sameGroup"><span class="hs-identifier hs-var">sameGroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Match.html#PgCo"><span class="hs-identifier hs-type">PgCo</span></a></span><span> </span><span id="local-6989586621681143460"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143460"><span class="hs-identifier hs-var">t1</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Match.html#PgCo"><span class="hs-identifier hs-type">PgCo</span></a></span><span> </span><span id="local-6989586621681143459"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143459"><span class="hs-identifier hs-var">t2</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143460"><span class="hs-identifier hs-var">t1</span></a></span><span> </span><span class="annot"><span class="annottext">Kind -&gt; Kind -&gt; Bool
</span><a href="GHC.Core.Type.html#eqType"><span class="hs-operator hs-var">`eqType`</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143459"><span class="hs-identifier hs-var">t2</span></a></span><span>
</span><span id="line-1024"></span><span>        </span><span class="hs-comment">-- CoPats are in the same goup only if the type of the</span><span>
</span><span id="line-1025"></span><span>        </span><span class="hs-comment">-- enclosed pattern is the same. The patterns outside the CoPat</span><span>
</span><span id="line-1026"></span><span>        </span><span class="hs-comment">-- always have the same type, so this boils down to saying that</span><span>
</span><span id="line-1027"></span><span>        </span><span class="hs-comment">-- the two coercions are identical.</span><span>
</span><span id="line-1028"></span><span class="annot"><a href="GHC.HsToCore.Match.html#sameGroup"><span class="hs-identifier hs-var">sameGroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Match.html#PgView"><span class="hs-identifier hs-type">PgView</span></a></span><span> </span><span id="local-6989586621681143457"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143457"><span class="hs-identifier hs-var">e1</span></a></span></span><span> </span><span id="local-6989586621681143456"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143456"><span class="hs-identifier hs-var">t1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Match.html#PgView"><span class="hs-identifier hs-type">PgView</span></a></span><span> </span><span id="local-6989586621681143455"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143455"><span class="hs-identifier hs-var">e2</span></a></span></span><span> </span><span id="local-6989586621681143454"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143454"><span class="hs-identifier hs-var">t2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LHsExpr GhcTc, Kind) -&gt; (LHsExpr GhcTc, Kind) -&gt; Bool
</span><a href="GHC.HsToCore.Match.html#viewLExprEq"><span class="hs-identifier hs-var">viewLExprEq</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143457"><span class="hs-identifier hs-var">e1</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143456"><span class="hs-identifier hs-var">t1</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143455"><span class="hs-identifier hs-var">e2</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143454"><span class="hs-identifier hs-var">t2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1029"></span><span>       </span><span class="hs-comment">-- ViewPats are in the same group iff the expressions</span><span>
</span><span id="line-1030"></span><span>       </span><span class="hs-comment">-- are &quot;equal&quot;---conservatively, we use syntactic equality</span><span>
</span><span id="line-1031"></span><span class="annot"><a href="GHC.HsToCore.Match.html#sameGroup"><span class="hs-identifier hs-var">sameGroup</span></a></span><span> </span><span class="annot"><span class="annottext">PatGroup
</span><span class="hs-identifier">_</span></span><span>          </span><span class="annot"><span class="annottext">PatGroup
</span><span class="hs-identifier">_</span></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1032"></span><span>
</span><span id="line-1033"></span><span class="hs-comment">-- An approximation of syntactic equality used for determining when view</span><span>
</span><span id="line-1034"></span><span class="hs-comment">-- exprs are in the same group.</span><span>
</span><span id="line-1035"></span><span class="hs-comment">-- This function can always safely return false;</span><span>
</span><span id="line-1036"></span><span class="hs-comment">-- but doing so will result in the application of the view function being repeated.</span><span>
</span><span id="line-1037"></span><span class="hs-comment">--</span><span>
</span><span id="line-1038"></span><span class="hs-comment">-- Currently: compare applications of literals and variables</span><span>
</span><span id="line-1039"></span><span class="hs-comment">--            and anything else that we can do without involving other</span><span>
</span><span id="line-1040"></span><span class="hs-comment">--            HsSyn types in the recursion</span><span>
</span><span id="line-1041"></span><span class="hs-comment">--</span><span>
</span><span id="line-1042"></span><span class="hs-comment">-- NB we can't assume that the two view expressions have the same type.  Consider</span><span>
</span><span id="line-1043"></span><span class="hs-comment">--   f (e1 -&gt; True) = ...</span><span>
</span><span id="line-1044"></span><span class="hs-comment">--   f (e2 -&gt; &quot;hi&quot;) = ...</span><span>
</span><span id="line-1045"></span><span class="annot"><a href="GHC.HsToCore.Match.html#viewLExprEq"><span class="hs-identifier hs-type">viewLExprEq</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1046"></span><span id="viewLExprEq"><span class="annot"><span class="annottext">viewLExprEq :: (LHsExpr GhcTc, Kind) -&gt; (LHsExpr GhcTc, Kind) -&gt; Bool
</span><a href="GHC.HsToCore.Match.html#viewLExprEq"><span class="hs-identifier hs-var hs-var">viewLExprEq</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681143452"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143452"><span class="hs-identifier hs-var">e1</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Kind
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681143451"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143451"><span class="hs-identifier hs-var">e2</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Kind
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; LHsExpr GhcTc -&gt; Bool
</span><a href="#local-6989586621681143450"><span class="hs-identifier hs-var">lexp</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143452"><span class="hs-identifier hs-var">e1</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143451"><span class="hs-identifier hs-var">e2</span></a></span><span>
</span><span id="line-1047"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1048"></span><span>    </span><span class="annot"><a href="#local-6989586621681143450"><span class="hs-identifier hs-type">lexp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1049"></span><span>    </span><span id="local-6989586621681143450"><span class="annot"><span class="annottext">lexp :: LHsExpr GhcTc -&gt; LHsExpr GhcTc -&gt; Bool
</span><a href="#local-6989586621681143450"><span class="hs-identifier hs-var hs-var">lexp</span></a></span></span><span> </span><span id="local-6989586621681143449"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143449"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span id="local-6989586621681143448"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143448"><span class="hs-identifier hs-var">e'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc -&gt; HsExpr GhcTc -&gt; Bool
</span><a href="#local-6989586621681143447"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; HsExpr GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143449"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; HsExpr GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143448"><span class="hs-identifier hs-var">e'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1050"></span><span>
</span><span id="line-1051"></span><span>    </span><span class="hs-comment">---------</span><span>
</span><span id="line-1052"></span><span>    </span><span class="annot"><a href="#local-6989586621681143447"><span class="hs-identifier hs-type">exp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsExpr"><span class="hs-identifier hs-type">HsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsExpr"><span class="hs-identifier hs-type">HsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1053"></span><span>    </span><span class="hs-comment">-- real comparison is on HsExpr's</span><span>
</span><span id="line-1054"></span><span>    </span><span class="hs-comment">-- strip parens</span><span>
</span><span id="line-1055"></span><span>    </span><span id="local-6989586621681143447"><span class="annot"><span class="annottext">exp :: HsExpr GhcTc -&gt; HsExpr GhcTc -&gt; Bool
</span><a href="#local-6989586621681143447"><span class="hs-identifier hs-var hs-var">exp</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsPar"><span class="hs-identifier hs-type">HsPar</span></a></span><span> </span><span class="annot"><span class="annottext">XPar GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143445"><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681143445"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681143444"><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681143444"><span class="hs-identifier hs-var">e'</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc -&gt; HsExpr GhcTc -&gt; Bool
</span><a href="#local-6989586621681143447"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681143445"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681143444"><span class="hs-identifier hs-var">e'</span></a></span><span>
</span><span id="line-1056"></span><span>    </span><span class="annot"><a href="#local-6989586621681143447"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span id="local-6989586621681143443"><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681143443"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsPar"><span class="hs-identifier hs-type">HsPar</span></a></span><span> </span><span class="annot"><span class="annottext">XPar GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143442"><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681143442"><span class="hs-identifier hs-var">e'</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc -&gt; HsExpr GhcTc -&gt; Bool
</span><a href="#local-6989586621681143447"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681143443"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681143442"><span class="hs-identifier hs-var">e'</span></a></span><span>
</span><span id="line-1057"></span><span>    </span><span class="hs-comment">-- because the expressions do not necessarily have the same type,</span><span>
</span><span id="line-1058"></span><span>    </span><span class="hs-comment">-- we have to compare the wrappers</span><span>
</span><span id="line-1059"></span><span>    </span><span class="annot"><a href="#local-6989586621681143447"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#XExpr"><span class="hs-identifier hs-type">XExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#WrapExpr"><span class="hs-identifier hs-type">WrapExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsWrap"><span class="hs-identifier hs-type">HsWrap</span></a></span><span> </span><span id="local-6989586621681143438"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143438"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span id="local-6989586621681143437"><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681143437"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#XExpr"><span class="hs-identifier hs-type">XExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#WrapExpr"><span class="hs-identifier hs-type">WrapExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsWrap"><span class="hs-identifier hs-type">HsWrap</span></a></span><span>  </span><span id="local-6989586621681143436"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143436"><span class="hs-identifier hs-var">h'</span></a></span></span><span> </span><span id="local-6989586621681143435"><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681143435"><span class="hs-identifier hs-var">e'</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1060"></span><span>      </span><span class="annot"><span class="annottext">HsWrapper -&gt; HsWrapper -&gt; Bool
</span><a href="#local-6989586621681143434"><span class="hs-identifier hs-var">wrap</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143438"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143436"><span class="hs-identifier hs-var">h'</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc -&gt; HsExpr GhcTc -&gt; Bool
</span><a href="#local-6989586621681143447"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681143437"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681143435"><span class="hs-identifier hs-var">e'</span></a></span><span>
</span><span id="line-1061"></span><span>    </span><span class="annot"><a href="#local-6989586621681143447"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#XExpr"><span class="hs-identifier hs-type">XExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ExpansionExpr"><span class="hs-identifier hs-type">ExpansionExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsExpanded"><span class="hs-identifier hs-type">HsExpanded</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143431"><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681143431"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#XExpr"><span class="hs-identifier hs-type">XExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ExpansionExpr"><span class="hs-identifier hs-type">ExpansionExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsExpanded"><span class="hs-identifier hs-type">HsExpanded</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143430"><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681143430"><span class="hs-identifier hs-var">b'</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1062"></span><span>      </span><span class="annot"><span class="annottext">HsExpr GhcTc -&gt; HsExpr GhcTc -&gt; Bool
</span><a href="#local-6989586621681143447"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681143431"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681143430"><span class="hs-identifier hs-var">b'</span></a></span><span>
</span><span id="line-1063"></span><span>    </span><span class="annot"><a href="#local-6989586621681143447"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsVar"><span class="hs-identifier hs-type">HsVar</span></a></span><span> </span><span class="annot"><span class="annottext">XVar GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143428"><span class="annot"><span class="annottext">GenLocated SrcSpan (IdP GhcTc)
</span><a href="#local-6989586621681143428"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsVar"><span class="hs-identifier hs-type">HsVar</span></a></span><span> </span><span class="annot"><span class="annottext">XVar GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143427"><span class="annot"><span class="annottext">GenLocated SrcSpan (IdP GhcTc)
</span><a href="#local-6989586621681143427"><span class="hs-identifier hs-var">i'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">Located Id
GenLocated SrcSpan (IdP GhcTc)
</span><a href="#local-6989586621681143428"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Located Id -&gt; Located Id -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Located Id
GenLocated SrcSpan (IdP GhcTc)
</span><a href="#local-6989586621681143427"><span class="hs-identifier hs-var">i'</span></a></span><span>
</span><span id="line-1064"></span><span>    </span><span class="annot"><a href="#local-6989586621681143447"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsConLikeOut"><span class="hs-identifier hs-type">HsConLikeOut</span></a></span><span> </span><span class="annot"><span class="annottext">XConLikeOut GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143425"><span class="annot"><span class="annottext">ConLike
</span><a href="#local-6989586621681143425"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsConLikeOut"><span class="hs-identifier hs-type">HsConLikeOut</span></a></span><span> </span><span class="annot"><span class="annottext">XConLikeOut GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143424"><span class="annot"><span class="annottext">ConLike
</span><a href="#local-6989586621681143424"><span class="hs-identifier hs-var">c'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ConLike
</span><a href="#local-6989586621681143425"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">ConLike -&gt; ConLike -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ConLike
</span><a href="#local-6989586621681143424"><span class="hs-identifier hs-var">c'</span></a></span><span>
</span><span id="line-1065"></span><span>    </span><span class="hs-comment">-- the instance for IPName derives using the id, so this works if the</span><span>
</span><span id="line-1066"></span><span>    </span><span class="hs-comment">-- above does</span><span>
</span><span id="line-1067"></span><span>    </span><span class="annot"><a href="#local-6989586621681143447"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsIPVar"><span class="hs-identifier hs-type">HsIPVar</span></a></span><span> </span><span class="annot"><span class="annottext">XIPVar GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143422"><span class="annot"><span class="annottext">HsIPName
</span><a href="#local-6989586621681143422"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsIPVar"><span class="hs-identifier hs-type">HsIPVar</span></a></span><span> </span><span class="annot"><span class="annottext">XIPVar GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143421"><span class="annot"><span class="annottext">HsIPName
</span><a href="#local-6989586621681143421"><span class="hs-identifier hs-var">i'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsIPName
</span><a href="#local-6989586621681143422"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">HsIPName -&gt; HsIPName -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">HsIPName
</span><a href="#local-6989586621681143421"><span class="hs-identifier hs-var">i'</span></a></span><span>
</span><span id="line-1068"></span><span>    </span><span class="annot"><a href="#local-6989586621681143447"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsOverLabel"><span class="hs-identifier hs-type">HsOverLabel</span></a></span><span> </span><span class="annot"><span class="annottext">XOverLabel GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143419"><span class="annot"><span class="annottext">Maybe (IdP GhcTc)
</span><a href="#local-6989586621681143419"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681143418"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681143418"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsOverLabel"><span class="hs-identifier hs-type">HsOverLabel</span></a></span><span> </span><span class="annot"><span class="annottext">XOverLabel GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143417"><span class="annot"><span class="annottext">Maybe (IdP GhcTc)
</span><a href="#local-6989586621681143417"><span class="hs-identifier hs-var">l'</span></a></span></span><span> </span><span id="local-6989586621681143416"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681143416"><span class="hs-identifier hs-var">x'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Id
Maybe (IdP GhcTc)
</span><a href="#local-6989586621681143419"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Id -&gt; Maybe Id -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Maybe Id
Maybe (IdP GhcTc)
</span><a href="#local-6989586621681143417"><span class="hs-identifier hs-var">l'</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681143418"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; FastString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681143416"><span class="hs-identifier hs-var">x'</span></a></span><span>
</span><span id="line-1069"></span><span>    </span><span class="annot"><a href="#local-6989586621681143447"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsOverLit"><span class="hs-identifier hs-type">HsOverLit</span></a></span><span> </span><span class="annot"><span class="annottext">XOverLitE GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143414"><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><a href="#local-6989586621681143414"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsOverLit"><span class="hs-identifier hs-type">HsOverLit</span></a></span><span> </span><span class="annot"><span class="annottext">XOverLitE GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143413"><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><a href="#local-6989586621681143413"><span class="hs-identifier hs-var">l'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1070"></span><span>        </span><span class="hs-comment">-- Overloaded lits are equal if they have the same type</span><span>
</span><span id="line-1071"></span><span>        </span><span class="hs-comment">-- and the data is the same.</span><span>
</span><span id="line-1072"></span><span>        </span><span class="hs-comment">-- this is coarser than comparing the SyntaxExpr's in l and l',</span><span>
</span><span id="line-1073"></span><span>        </span><span class="hs-comment">-- which resolve the overloading (e.g., fromInteger 1),</span><span>
</span><span id="line-1074"></span><span>        </span><span class="hs-comment">-- because these expressions get written as a bunch of different variables</span><span>
</span><span id="line-1075"></span><span>        </span><span class="hs-comment">-- (presumably to improve sharing)</span><span>
</span><span id="line-1076"></span><span>        </span><span class="annot"><span class="annottext">Kind -&gt; Kind -&gt; Bool
</span><a href="GHC.Core.Type.html#eqType"><span class="hs-identifier hs-var">eqType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsOverLit GhcTc -&gt; Kind
</span><a href="GHC.Hs.Lit.html#overLitType"><span class="hs-identifier hs-var">overLitType</span></a></span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><a href="#local-6989586621681143414"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsOverLit GhcTc -&gt; Kind
</span><a href="GHC.Hs.Lit.html#overLitType"><span class="hs-identifier hs-var">overLitType</span></a></span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><a href="#local-6989586621681143413"><span class="hs-identifier hs-var">l'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><a href="#local-6989586621681143414"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc -&gt; HsOverLit GhcTc -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><a href="#local-6989586621681143413"><span class="hs-identifier hs-var">l'</span></a></span><span>
</span><span id="line-1077"></span><span>    </span><span class="annot"><a href="#local-6989586621681143447"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsApp"><span class="hs-identifier hs-type">HsApp</span></a></span><span> </span><span class="annot"><span class="annottext">XApp GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143410"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143410"><span class="hs-identifier hs-var">e1</span></a></span></span><span> </span><span id="local-6989586621681143409"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143409"><span class="hs-identifier hs-var">e2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsApp"><span class="hs-identifier hs-type">HsApp</span></a></span><span> </span><span class="annot"><span class="annottext">XApp GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143408"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143408"><span class="hs-identifier hs-var">e1'</span></a></span></span><span> </span><span id="local-6989586621681143407"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143407"><span class="hs-identifier hs-var">e2'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; LHsExpr GhcTc -&gt; Bool
</span><a href="#local-6989586621681143450"><span class="hs-identifier hs-var">lexp</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143410"><span class="hs-identifier hs-var">e1</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143408"><span class="hs-identifier hs-var">e1'</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; LHsExpr GhcTc -&gt; Bool
</span><a href="#local-6989586621681143450"><span class="hs-identifier hs-var">lexp</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143409"><span class="hs-identifier hs-var">e2</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143407"><span class="hs-identifier hs-var">e2'</span></a></span><span>
</span><span id="line-1078"></span><span>    </span><span class="hs-comment">-- the fixities have been straightened out by now, so it's safe</span><span>
</span><span id="line-1079"></span><span>    </span><span class="hs-comment">-- to ignore them?</span><span>
</span><span id="line-1080"></span><span>    </span><span class="annot"><a href="#local-6989586621681143447"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#OpApp"><span class="hs-identifier hs-type">OpApp</span></a></span><span> </span><span class="annot"><span class="annottext">XOpApp GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143405"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143405"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681143404"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143404"><span class="hs-identifier hs-var">o</span></a></span></span><span> </span><span id="local-6989586621681143403"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143403"><span class="hs-identifier hs-var">ri</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#OpApp"><span class="hs-identifier hs-type">OpApp</span></a></span><span> </span><span class="annot"><span class="annottext">XOpApp GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143402"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143402"><span class="hs-identifier hs-var">l'</span></a></span></span><span> </span><span id="local-6989586621681143401"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143401"><span class="hs-identifier hs-var">o'</span></a></span></span><span> </span><span id="local-6989586621681143400"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143400"><span class="hs-identifier hs-var">ri'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1081"></span><span>        </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; LHsExpr GhcTc -&gt; Bool
</span><a href="#local-6989586621681143450"><span class="hs-identifier hs-var">lexp</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143405"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143402"><span class="hs-identifier hs-var">l'</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; LHsExpr GhcTc -&gt; Bool
</span><a href="#local-6989586621681143450"><span class="hs-identifier hs-var">lexp</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143404"><span class="hs-identifier hs-var">o</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143401"><span class="hs-identifier hs-var">o'</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; LHsExpr GhcTc -&gt; Bool
</span><a href="#local-6989586621681143450"><span class="hs-identifier hs-var">lexp</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143403"><span class="hs-identifier hs-var">ri</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143400"><span class="hs-identifier hs-var">ri'</span></a></span><span>
</span><span id="line-1082"></span><span>    </span><span class="annot"><a href="#local-6989586621681143447"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#NegApp"><span class="hs-identifier hs-type">NegApp</span></a></span><span> </span><span class="annot"><span class="annottext">XNegApp GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143398"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143398"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span id="local-6989586621681143397"><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681143397"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#NegApp"><span class="hs-identifier hs-type">NegApp</span></a></span><span> </span><span class="annot"><span class="annottext">XNegApp GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143396"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143396"><span class="hs-identifier hs-var">e'</span></a></span></span><span> </span><span id="local-6989586621681143395"><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681143395"><span class="hs-identifier hs-var">n'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; LHsExpr GhcTc -&gt; Bool
</span><a href="#local-6989586621681143450"><span class="hs-identifier hs-var">lexp</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143398"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143396"><span class="hs-identifier hs-var">e'</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc -&gt; SyntaxExpr GhcTc -&gt; Bool
</span><a href="#local-6989586621681143394"><span class="hs-identifier hs-var">syn_exp</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681143397"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681143395"><span class="hs-identifier hs-var">n'</span></a></span><span>
</span><span id="line-1083"></span><span>    </span><span class="annot"><a href="#local-6989586621681143447"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#SectionL"><span class="hs-identifier hs-type">SectionL</span></a></span><span> </span><span class="annot"><span class="annottext">XSectionL GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143392"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143392"><span class="hs-identifier hs-var">e1</span></a></span></span><span> </span><span id="local-6989586621681143391"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143391"><span class="hs-identifier hs-var">e2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#SectionL"><span class="hs-identifier hs-type">SectionL</span></a></span><span> </span><span class="annot"><span class="annottext">XSectionL GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143390"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143390"><span class="hs-identifier hs-var">e1'</span></a></span></span><span> </span><span id="local-6989586621681143389"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143389"><span class="hs-identifier hs-var">e2'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1084"></span><span>        </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; LHsExpr GhcTc -&gt; Bool
</span><a href="#local-6989586621681143450"><span class="hs-identifier hs-var">lexp</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143392"><span class="hs-identifier hs-var">e1</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143390"><span class="hs-identifier hs-var">e1'</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; LHsExpr GhcTc -&gt; Bool
</span><a href="#local-6989586621681143450"><span class="hs-identifier hs-var">lexp</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143391"><span class="hs-identifier hs-var">e2</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143389"><span class="hs-identifier hs-var">e2'</span></a></span><span>
</span><span id="line-1085"></span><span>    </span><span class="annot"><a href="#local-6989586621681143447"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#SectionR"><span class="hs-identifier hs-type">SectionR</span></a></span><span> </span><span class="annot"><span class="annottext">XSectionR GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143387"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143387"><span class="hs-identifier hs-var">e1</span></a></span></span><span> </span><span id="local-6989586621681143386"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143386"><span class="hs-identifier hs-var">e2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#SectionR"><span class="hs-identifier hs-type">SectionR</span></a></span><span> </span><span class="annot"><span class="annottext">XSectionR GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143385"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143385"><span class="hs-identifier hs-var">e1'</span></a></span></span><span> </span><span id="local-6989586621681143384"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143384"><span class="hs-identifier hs-var">e2'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1086"></span><span>        </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; LHsExpr GhcTc -&gt; Bool
</span><a href="#local-6989586621681143450"><span class="hs-identifier hs-var">lexp</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143387"><span class="hs-identifier hs-var">e1</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143385"><span class="hs-identifier hs-var">e1'</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; LHsExpr GhcTc -&gt; Bool
</span><a href="#local-6989586621681143450"><span class="hs-identifier hs-var">lexp</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143386"><span class="hs-identifier hs-var">e2</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143384"><span class="hs-identifier hs-var">e2'</span></a></span><span>
</span><span id="line-1087"></span><span>    </span><span class="annot"><a href="#local-6989586621681143447"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ExplicitTuple"><span class="hs-identifier hs-type">ExplicitTuple</span></a></span><span> </span><span class="annot"><span class="annottext">XExplicitTuple GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143382"><span class="annot"><span class="annottext">[LHsTupArg GhcTc]
</span><a href="#local-6989586621681143382"><span class="hs-identifier hs-var">es1</span></a></span></span><span> </span><span class="annot"><span class="annottext">Boxity
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ExplicitTuple"><span class="hs-identifier hs-type">ExplicitTuple</span></a></span><span> </span><span class="annot"><span class="annottext">XExplicitTuple GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143381"><span class="annot"><span class="annottext">[LHsTupArg GhcTc]
</span><a href="#local-6989586621681143381"><span class="hs-identifier hs-var">es2</span></a></span></span><span> </span><span class="annot"><span class="annottext">Boxity
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1088"></span><span>        </span><span class="annot"><span class="annottext">(LHsTupArg GhcTc -&gt; LHsTupArg GhcTc -&gt; Bool)
-&gt; [LHsTupArg GhcTc] -&gt; [LHsTupArg GhcTc] -&gt; Bool
forall a. (a -&gt; a -&gt; Bool) -&gt; [a] -&gt; [a] -&gt; Bool
</span><a href="#local-6989586621681143380"><span class="hs-identifier hs-var">eq_list</span></a></span><span> </span><span class="annot"><span class="annottext">LHsTupArg GhcTc -&gt; LHsTupArg GhcTc -&gt; Bool
forall {l} {l}.
GenLocated l (HsTupArg GhcTc)
-&gt; GenLocated l (HsTupArg GhcTc) -&gt; Bool
</span><a href="#local-6989586621681143379"><span class="hs-identifier hs-var">tup_arg</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsTupArg GhcTc]
</span><a href="#local-6989586621681143382"><span class="hs-identifier hs-var">es1</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsTupArg GhcTc]
</span><a href="#local-6989586621681143381"><span class="hs-identifier hs-var">es2</span></a></span><span>
</span><span id="line-1089"></span><span>    </span><span class="annot"><a href="#local-6989586621681143447"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ExplicitSum"><span class="hs-identifier hs-type">ExplicitSum</span></a></span><span> </span><span class="annot"><span class="annottext">XExplicitSum GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143377"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143377"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ExplicitSum"><span class="hs-identifier hs-type">ExplicitSum</span></a></span><span> </span><span class="annot"><span class="annottext">XExplicitSum GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143376"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143376"><span class="hs-identifier hs-var">e'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; LHsExpr GhcTc -&gt; Bool
</span><a href="#local-6989586621681143450"><span class="hs-identifier hs-var">lexp</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143377"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143376"><span class="hs-identifier hs-var">e'</span></a></span><span>
</span><span id="line-1090"></span><span>    </span><span class="annot"><a href="#local-6989586621681143447"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsIf"><span class="hs-identifier hs-type">HsIf</span></a></span><span> </span><span class="annot"><span class="annottext">XIf GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143374"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143374"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span id="local-6989586621681143373"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143373"><span class="hs-identifier hs-var">e1</span></a></span></span><span> </span><span id="local-6989586621681143372"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143372"><span class="hs-identifier hs-var">e2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsIf"><span class="hs-identifier hs-type">HsIf</span></a></span><span> </span><span class="annot"><span class="annottext">XIf GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143371"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143371"><span class="hs-identifier hs-var">e'</span></a></span></span><span> </span><span id="local-6989586621681143370"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143370"><span class="hs-identifier hs-var">e1'</span></a></span></span><span> </span><span id="local-6989586621681143369"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143369"><span class="hs-identifier hs-var">e2'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1091"></span><span>        </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; LHsExpr GhcTc -&gt; Bool
</span><a href="#local-6989586621681143450"><span class="hs-identifier hs-var">lexp</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143374"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143371"><span class="hs-identifier hs-var">e'</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; LHsExpr GhcTc -&gt; Bool
</span><a href="#local-6989586621681143450"><span class="hs-identifier hs-var">lexp</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143373"><span class="hs-identifier hs-var">e1</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143370"><span class="hs-identifier hs-var">e1'</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; LHsExpr GhcTc -&gt; Bool
</span><a href="#local-6989586621681143450"><span class="hs-identifier hs-var">lexp</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143372"><span class="hs-identifier hs-var">e2</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143369"><span class="hs-identifier hs-var">e2'</span></a></span><span>
</span><span id="line-1092"></span><span>
</span><span id="line-1093"></span><span>    </span><span class="hs-comment">-- Enhancement: could implement equality for more expressions</span><span>
</span><span id="line-1094"></span><span>    </span><span class="hs-comment">--   if it seems useful</span><span>
</span><span id="line-1095"></span><span>    </span><span class="hs-comment">-- But no need for HsLit, ExplicitList, ExplicitTuple,</span><span>
</span><span id="line-1096"></span><span>    </span><span class="hs-comment">-- because they cannot be functions</span><span>
</span><span id="line-1097"></span><span>    </span><span class="annot"><a href="#local-6989586621681143447"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1098"></span><span>
</span><span id="line-1099"></span><span>    </span><span class="hs-comment">---------</span><span>
</span><span id="line-1100"></span><span>    </span><span class="annot"><a href="#local-6989586621681143394"><span class="hs-identifier hs-type">syn_exp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#SyntaxExpr"><span class="hs-identifier hs-type">SyntaxExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#SyntaxExpr"><span class="hs-identifier hs-type">SyntaxExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1101"></span><span>    </span><span id="local-6989586621681143394"><span class="annot"><span class="annottext">syn_exp :: SyntaxExpr GhcTc -&gt; SyntaxExpr GhcTc -&gt; Bool
</span><a href="#local-6989586621681143394"><span class="hs-identifier hs-var hs-var">syn_exp</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#SyntaxExprTc"><span class="hs-identifier hs-type">SyntaxExprTc</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">syn_expr :: SyntaxExprTc -&gt; HsExpr GhcTc
</span><a href="GHC.Hs.Expr.html#syn_expr"><span class="hs-identifier hs-var">syn_expr</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681143366"><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681143366"><span class="hs-identifier hs-var">expr1</span></a></span></span><span>
</span><span id="line-1102"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">syn_arg_wraps :: SyntaxExprTc -&gt; [HsWrapper]
</span><a href="GHC.Hs.Expr.html#syn_arg_wraps"><span class="hs-identifier hs-var">syn_arg_wraps</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681143364"><span class="annot"><span class="annottext">[HsWrapper]
</span><a href="#local-6989586621681143364"><span class="hs-identifier hs-var">arg_wraps1</span></a></span></span><span>
</span><span id="line-1103"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">syn_res_wrap :: SyntaxExprTc -&gt; HsWrapper
</span><a href="GHC.Hs.Expr.html#syn_res_wrap"><span class="hs-identifier hs-var">syn_res_wrap</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681143362"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143362"><span class="hs-identifier hs-var">res_wrap1</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-1104"></span><span>            </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#SyntaxExprTc"><span class="hs-identifier hs-type">SyntaxExprTc</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">syn_expr :: SyntaxExprTc -&gt; HsExpr GhcTc
</span><a href="GHC.Hs.Expr.html#syn_expr"><span class="hs-identifier hs-var">syn_expr</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681143361"><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681143361"><span class="hs-identifier hs-var">expr2</span></a></span></span><span>
</span><span id="line-1105"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">syn_arg_wraps :: SyntaxExprTc -&gt; [HsWrapper]
</span><a href="GHC.Hs.Expr.html#syn_arg_wraps"><span class="hs-identifier hs-var">syn_arg_wraps</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681143360"><span class="annot"><span class="annottext">[HsWrapper]
</span><a href="#local-6989586621681143360"><span class="hs-identifier hs-var">arg_wraps2</span></a></span></span><span>
</span><span id="line-1106"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">syn_res_wrap :: SyntaxExprTc -&gt; HsWrapper
</span><a href="GHC.Hs.Expr.html#syn_res_wrap"><span class="hs-identifier hs-var">syn_res_wrap</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681143359"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143359"><span class="hs-identifier hs-var">res_wrap2</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-1107"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc -&gt; HsExpr GhcTc -&gt; Bool
</span><a href="#local-6989586621681143447"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681143366"><span class="hs-identifier hs-var">expr1</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681143361"><span class="hs-identifier hs-var">expr2</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span>
</span><span id="line-1108"></span><span>        </span><span class="annot"><span class="annottext">[Bool] -&gt; Bool
forall (t :: * -&gt; *). Foldable t =&gt; t Bool -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#and"><span class="hs-identifier hs-var">and</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
-&gt; (HsWrapper -&gt; HsWrapper -&gt; Bool)
-&gt; [HsWrapper]
-&gt; [HsWrapper]
-&gt; [Bool]
forall a b c. String -&gt; (a -&gt; b -&gt; c) -&gt; [a] -&gt; [b] -&gt; [c]
</span><a href="GHC.Utils.Misc.html#zipWithEqual"><span class="hs-identifier hs-var">zipWithEqual</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;viewLExprEq&quot;</span></span><span> </span><span class="annot"><span class="annottext">HsWrapper -&gt; HsWrapper -&gt; Bool
</span><a href="#local-6989586621681143434"><span class="hs-identifier hs-var">wrap</span></a></span><span> </span><span class="annot"><span class="annottext">[HsWrapper]
</span><a href="#local-6989586621681143364"><span class="hs-identifier hs-var">arg_wraps1</span></a></span><span> </span><span class="annot"><span class="annottext">[HsWrapper]
</span><a href="#local-6989586621681143360"><span class="hs-identifier hs-var">arg_wraps2</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span>
</span><span id="line-1109"></span><span>        </span><span class="annot"><span class="annottext">HsWrapper -&gt; HsWrapper -&gt; Bool
</span><a href="#local-6989586621681143434"><span class="hs-identifier hs-var">wrap</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143362"><span class="hs-identifier hs-var">res_wrap1</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143359"><span class="hs-identifier hs-var">res_wrap2</span></a></span><span>
</span><span id="line-1110"></span><span>    </span><span class="annot"><a href="#local-6989586621681143394"><span class="hs-identifier hs-var">syn_exp</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
SyntaxExprTc
</span><a href="GHC.Hs.Expr.html#NoSyntaxExprTc"><span class="hs-identifier hs-var">NoSyntaxExprTc</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
SyntaxExprTc
</span><a href="GHC.Hs.Expr.html#NoSyntaxExprTc"><span class="hs-identifier hs-var">NoSyntaxExprTc</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1111"></span><span>    </span><span class="annot"><a href="#local-6989586621681143394"><span class="hs-identifier hs-var">syn_exp</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><span class="hs-identifier">_</span></span><span>              </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><span class="hs-identifier">_</span></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1112"></span><span>
</span><span id="line-1113"></span><span>    </span><span class="hs-comment">---------</span><span>
</span><span id="line-1114"></span><span>    </span><span id="local-6989586621681143379"><span class="annot"><span class="annottext">tup_arg :: GenLocated l (HsTupArg GhcTc)
-&gt; GenLocated l (HsTupArg GhcTc) -&gt; Bool
</span><a href="#local-6989586621681143379"><span class="hs-identifier hs-var hs-var">tup_arg</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">l
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#Present"><span class="hs-identifier hs-type">Present</span></a></span><span> </span><span class="annot"><span class="annottext">XPresent GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143355"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143355"><span class="hs-identifier hs-var">e1</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">l
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#Present"><span class="hs-identifier hs-type">Present</span></a></span><span> </span><span class="annot"><span class="annottext">XPresent GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143354"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143354"><span class="hs-identifier hs-var">e2</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; LHsExpr GhcTc -&gt; Bool
</span><a href="#local-6989586621681143450"><span class="hs-identifier hs-var">lexp</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143355"><span class="hs-identifier hs-var">e1</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143354"><span class="hs-identifier hs-var">e2</span></a></span><span>
</span><span id="line-1115"></span><span>    </span><span class="annot"><a href="#local-6989586621681143379"><span class="hs-identifier hs-var">tup_arg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">l
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#Missing"><span class="hs-identifier hs-type">Missing</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Scaled"><span class="hs-identifier hs-type">Scaled</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143351"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143351"><span class="hs-identifier hs-var">t1</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>   </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">l
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#Missing"><span class="hs-identifier hs-type">Missing</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Scaled"><span class="hs-identifier hs-type">Scaled</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143350"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143350"><span class="hs-identifier hs-var">t2</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind -&gt; Kind -&gt; Bool
</span><a href="GHC.Core.Type.html#eqType"><span class="hs-identifier hs-var">eqType</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143351"><span class="hs-identifier hs-var">t1</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143350"><span class="hs-identifier hs-var">t2</span></a></span><span>
</span><span id="line-1116"></span><span>    </span><span class="annot"><a href="#local-6989586621681143379"><span class="hs-identifier hs-var">tup_arg</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated l (HsTupArg GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">GenLocated l (HsTupArg GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1117"></span><span>
</span><span id="line-1118"></span><span>    </span><span class="hs-comment">---------</span><span>
</span><span id="line-1119"></span><span>    </span><span class="annot"><a href="#local-6989586621681143434"><span class="hs-identifier hs-type">wrap</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#HsWrapper"><span class="hs-identifier hs-type">HsWrapper</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#HsWrapper"><span class="hs-identifier hs-type">HsWrapper</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1120"></span><span>    </span><span class="hs-comment">-- Conservative, in that it demands that wrappers be</span><span>
</span><span id="line-1121"></span><span>    </span><span class="hs-comment">-- syntactically identical and doesn't look under binders</span><span>
</span><span id="line-1122"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-1123"></span><span>    </span><span class="hs-comment">-- Coarser notions of equality are possible</span><span>
</span><span id="line-1124"></span><span>    </span><span class="hs-comment">-- (e.g., reassociating compositions,</span><span>
</span><span id="line-1125"></span><span>    </span><span class="hs-comment">--        equating different ways of writing a coercion)</span><span>
</span><span id="line-1126"></span><span>    </span><span id="local-6989586621681143434"><span class="annot"><span class="annottext">wrap :: HsWrapper -&gt; HsWrapper -&gt; Bool
</span><a href="#local-6989586621681143434"><span class="hs-identifier hs-var hs-var">wrap</span></a></span></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="GHC.Tc.Types.Evidence.html#WpHole"><span class="hs-identifier hs-var">WpHole</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="GHC.Tc.Types.Evidence.html#WpHole"><span class="hs-identifier hs-var">WpHole</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1127"></span><span>    </span><span class="annot"><a href="#local-6989586621681143434"><span class="hs-identifier hs-var">wrap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#WpCompose"><span class="hs-identifier hs-type">WpCompose</span></a></span><span> </span><span id="local-6989586621681143347"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143347"><span class="hs-identifier hs-var">w1</span></a></span></span><span> </span><span id="local-6989586621681143346"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143346"><span class="hs-identifier hs-var">w2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#WpCompose"><span class="hs-identifier hs-type">WpCompose</span></a></span><span> </span><span id="local-6989586621681143345"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143345"><span class="hs-identifier hs-var">w1'</span></a></span></span><span> </span><span id="local-6989586621681143344"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143344"><span class="hs-identifier hs-var">w2'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsWrapper -&gt; HsWrapper -&gt; Bool
</span><a href="#local-6989586621681143434"><span class="hs-identifier hs-var">wrap</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143347"><span class="hs-identifier hs-var">w1</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143345"><span class="hs-identifier hs-var">w1'</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">HsWrapper -&gt; HsWrapper -&gt; Bool
</span><a href="#local-6989586621681143434"><span class="hs-identifier hs-var">wrap</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143346"><span class="hs-identifier hs-var">w2</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143344"><span class="hs-identifier hs-var">w2'</span></a></span><span>
</span><span id="line-1128"></span><span>    </span><span class="annot"><a href="#local-6989586621681143434"><span class="hs-identifier hs-var">wrap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#WpFun"><span class="hs-identifier hs-type">WpFun</span></a></span><span> </span><span id="local-6989586621681143342"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143342"><span class="hs-identifier hs-var">w1</span></a></span></span><span> </span><span id="local-6989586621681143341"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143341"><span class="hs-identifier hs-var">w2</span></a></span></span><span> </span><span class="annot"><span class="annottext">Scaled Kind
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#WpFun"><span class="hs-identifier hs-type">WpFun</span></a></span><span> </span><span id="local-6989586621681143340"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143340"><span class="hs-identifier hs-var">w1'</span></a></span></span><span> </span><span id="local-6989586621681143339"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143339"><span class="hs-identifier hs-var">w2'</span></a></span></span><span> </span><span class="annot"><span class="annottext">Scaled Kind
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsWrapper -&gt; HsWrapper -&gt; Bool
</span><a href="#local-6989586621681143434"><span class="hs-identifier hs-var">wrap</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143342"><span class="hs-identifier hs-var">w1</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143340"><span class="hs-identifier hs-var">w1'</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">HsWrapper -&gt; HsWrapper -&gt; Bool
</span><a href="#local-6989586621681143434"><span class="hs-identifier hs-var">wrap</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143341"><span class="hs-identifier hs-var">w2</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681143339"><span class="hs-identifier hs-var">w2'</span></a></span><span>
</span><span id="line-1129"></span><span>    </span><span class="annot"><a href="#local-6989586621681143434"><span class="hs-identifier hs-var">wrap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#WpCast"><span class="hs-identifier hs-type">WpCast</span></a></span><span> </span><span id="local-6989586621681143337"><span class="annot"><span class="annottext">TcCoercionR
</span><a href="#local-6989586621681143337"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#WpCast"><span class="hs-identifier hs-type">WpCast</span></a></span><span> </span><span id="local-6989586621681143336"><span class="annot"><span class="annottext">TcCoercionR
</span><a href="#local-6989586621681143336"><span class="hs-identifier hs-var">co'</span></a></span></span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcCoercionR
</span><a href="#local-6989586621681143337"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">TcCoercionR -&gt; TcCoercionR -&gt; Bool
</span><a href="GHC.Core.Coercion.html#eqCoercion"><span class="hs-operator hs-var">`eqCoercion`</span></a></span><span> </span><span class="annot"><span class="annottext">TcCoercionR
</span><a href="#local-6989586621681143336"><span class="hs-identifier hs-var">co'</span></a></span><span>
</span><span id="line-1130"></span><span>    </span><span class="annot"><a href="#local-6989586621681143434"><span class="hs-identifier hs-var">wrap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#WpEvApp"><span class="hs-identifier hs-type">WpEvApp</span></a></span><span> </span><span id="local-6989586621681143334"><span class="annot"><span class="annottext">EvTerm
</span><a href="#local-6989586621681143334"><span class="hs-identifier hs-var">et1</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#WpEvApp"><span class="hs-identifier hs-type">WpEvApp</span></a></span><span> </span><span id="local-6989586621681143333"><span class="annot"><span class="annottext">EvTerm
</span><a href="#local-6989586621681143333"><span class="hs-identifier hs-var">et2</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">EvTerm
</span><a href="#local-6989586621681143334"><span class="hs-identifier hs-var">et1</span></a></span><span> </span><span class="annot"><span class="annottext">EvTerm -&gt; EvTerm -&gt; Bool
</span><a href="#local-6989586621681143332"><span class="hs-operator hs-var">`ev_term`</span></a></span><span> </span><span class="annot"><span class="annottext">EvTerm
</span><a href="#local-6989586621681143333"><span class="hs-identifier hs-var">et2</span></a></span><span>
</span><span id="line-1131"></span><span>    </span><span class="annot"><a href="#local-6989586621681143434"><span class="hs-identifier hs-var">wrap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#WpTyApp"><span class="hs-identifier hs-type">WpTyApp</span></a></span><span> </span><span id="local-6989586621681143330"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143330"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#WpTyApp"><span class="hs-identifier hs-type">WpTyApp</span></a></span><span> </span><span id="local-6989586621681143329"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143329"><span class="hs-identifier hs-var">t'</span></a></span></span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind -&gt; Kind -&gt; Bool
</span><a href="GHC.Core.Type.html#eqType"><span class="hs-identifier hs-var">eqType</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143330"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681143329"><span class="hs-identifier hs-var">t'</span></a></span><span>
</span><span id="line-1132"></span><span>    </span><span class="hs-comment">-- Enhancement: could implement equality for more wrappers</span><span>
</span><span id="line-1133"></span><span>    </span><span class="hs-comment">--   if it seems useful (lams and lets)</span><span>
</span><span id="line-1134"></span><span>    </span><span class="annot"><a href="#local-6989586621681143434"><span class="hs-identifier hs-var">wrap</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1135"></span><span>
</span><span id="line-1136"></span><span>    </span><span class="hs-comment">---------</span><span>
</span><span id="line-1137"></span><span>    </span><span class="annot"><a href="#local-6989586621681143332"><span class="hs-identifier hs-type">ev_term</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvTerm"><span class="hs-identifier hs-type">EvTerm</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvTerm"><span class="hs-identifier hs-type">EvTerm</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1138"></span><span>    </span><span id="local-6989586621681143332"><span class="annot"><span class="annottext">ev_term :: EvTerm -&gt; EvTerm -&gt; Bool
</span><a href="#local-6989586621681143332"><span class="hs-identifier hs-var hs-var">ev_term</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvExpr"><span class="hs-identifier hs-type">EvExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span> </span><span id="local-6989586621681143327"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143327"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvExpr"><span class="hs-identifier hs-type">EvExpr</span></a></span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span> </span><span id="local-6989586621681143326"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143326"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143327"><span class="hs-identifier hs-var">a</span></a></span><span class="annot"><span class="annottext">Id -&gt; Id -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681143326"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-1139"></span><span>    </span><span class="annot"><a href="#local-6989586621681143332"><span class="hs-identifier hs-var">ev_term</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvExpr"><span class="hs-identifier hs-type">EvExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span> </span><span id="local-6989586621681143324"><span class="annot"><span class="annottext">TcCoercionR
</span><a href="#local-6989586621681143324"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvExpr"><span class="hs-identifier hs-type">EvExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span> </span><span id="local-6989586621681143323"><span class="annot"><span class="annottext">TcCoercionR
</span><a href="#local-6989586621681143323"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcCoercionR
</span><a href="#local-6989586621681143324"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">TcCoercionR -&gt; TcCoercionR -&gt; Bool
</span><a href="GHC.Core.Coercion.html#eqCoercion"><span class="hs-operator hs-var">`eqCoercion`</span></a></span><span> </span><span class="annot"><span class="annottext">TcCoercionR
</span><a href="#local-6989586621681143323"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-1140"></span><span>    </span><span class="annot"><a href="#local-6989586621681143332"><span class="hs-identifier hs-var">ev_term</span></a></span><span> </span><span class="annot"><span class="annottext">EvTerm
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">EvTerm
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1141"></span><span>
</span><span id="line-1142"></span><span>    </span><span class="hs-comment">---------</span><span>
</span><span id="line-1143"></span><span>    </span><span id="local-6989586621681144285"><span class="annot"><a href="#local-6989586621681143380"><span class="hs-identifier hs-type">eq_list</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681144285"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-glyph">-&gt;</span><span class="annot"><a href="#local-6989586621681144285"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-glyph">-&gt;</span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621681144285"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621681144285"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span></span><span>
</span><span id="line-1144"></span><span>    </span><span id="local-6989586621681143380"><span class="annot"><span class="annottext">eq_list :: forall a. (a -&gt; a -&gt; Bool) -&gt; [a] -&gt; [a] -&gt; Bool
</span><a href="#local-6989586621681143380"><span class="hs-identifier hs-var hs-var">eq_list</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1145"></span><span>    </span><span class="annot"><a href="#local-6989586621681143380"><span class="hs-identifier hs-var">eq_list</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">[a]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1146"></span><span>    </span><span class="annot"><a href="#local-6989586621681143380"><span class="hs-identifier hs-var">eq_list</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">[a]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>  </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1147"></span><span>    </span><span class="annot"><a href="#local-6989586621681143380"><span class="hs-identifier hs-var">eq_list</span></a></span><span> </span><span id="local-6989586621681143318"><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
</span><a href="#local-6989586621681143318"><span class="hs-identifier hs-var">eq</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681143317"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681143317"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681143316"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681143316"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681143315"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681143315"><span class="hs-identifier hs-var">y</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681143314"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681143314"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
</span><a href="#local-6989586621681143318"><span class="hs-identifier hs-var">eq</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681143317"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681143315"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">(a -&gt; a -&gt; Bool) -&gt; [a] -&gt; [a] -&gt; Bool
forall a. (a -&gt; a -&gt; Bool) -&gt; [a] -&gt; [a] -&gt; Bool
</span><a href="#local-6989586621681143380"><span class="hs-identifier hs-var">eq_list</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
</span><a href="#local-6989586621681143318"><span class="hs-identifier hs-var">eq</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681143316"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681143314"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-1148"></span><span>
</span><span id="line-1149"></span><span class="annot"><a href="GHC.HsToCore.Match.html#patGroup"><span class="hs-identifier hs-type">patGroup</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#Pat"><span class="hs-identifier hs-type">Pat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.html#PatGroup"><span class="hs-identifier hs-type">PatGroup</span></a></span><span>
</span><span id="line-1150"></span><span id="patGroup"><span class="annot"><span class="annottext">patGroup :: Platform -&gt; Pat GhcTc -&gt; PatGroup
</span><a href="GHC.HsToCore.Match.html#patGroup"><span class="hs-identifier hs-var hs-var">patGroup</span></a></span></span><span> </span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#ConPat"><span class="hs-identifier hs-type">ConPat</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">pat_con :: forall p. Pat p -&gt; Located (ConLikeP p)
</span><a href="GHC.Hs.Pat.html#pat_con"><span class="hs-identifier hs-var">pat_con</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143313"><span class="annot"><span class="annottext">ConLikeP GhcTc
</span><a href="#local-6989586621681143313"><span class="hs-identifier hs-var">con</span></a></span></span><span>
</span><span id="line-1151"></span><span>                   </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">pat_con_ext :: forall p. Pat p -&gt; XConPat p
</span><a href="GHC.Hs.Pat.html#pat_con_ext"><span class="hs-identifier hs-var">pat_con_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#ConPatTc"><span class="hs-identifier hs-type">ConPatTc</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cpt_arg_tys :: ConPatTc -&gt; [Kind]
</span><a href="GHC.Hs.Pat.html#cpt_arg_tys"><span class="hs-identifier hs-var">cpt_arg_tys</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681143312"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681143312"><span class="hs-identifier hs-var">tys</span></a></span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1152"></span><span>                   </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-1153"></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.ConLike.html#RealDataCon"><span class="hs-identifier hs-type">RealDataCon</span></a></span><span> </span><span id="local-6989586621681143311"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681143311"><span class="hs-identifier hs-var">dcon</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ConLikeP GhcTc
</span><a href="#local-6989586621681143313"><span class="hs-identifier hs-var">con</span></a></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; PatGroup
</span><a href="GHC.HsToCore.Match.html#PgCon"><span class="hs-identifier hs-var">PgCon</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681143311"><span class="hs-identifier hs-var">dcon</span></a></span><span>
</span><span id="line-1154"></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.ConLike.html#PatSynCon"><span class="hs-identifier hs-type">PatSynCon</span></a></span><span> </span><span id="local-6989586621681143309"><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621681143309"><span class="hs-identifier hs-var">psyn</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ConLikeP GhcTc
</span><a href="#local-6989586621681143313"><span class="hs-identifier hs-var">con</span></a></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PatSyn -&gt; [Kind] -&gt; PatGroup
</span><a href="GHC.HsToCore.Match.html#PgSyn"><span class="hs-identifier hs-var">PgSyn</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621681143309"><span class="hs-identifier hs-var">psyn</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681143312"><span class="hs-identifier hs-var">tys</span></a></span><span>
</span><span id="line-1155"></span><span class="annot"><a href="GHC.HsToCore.Match.html#patGroup"><span class="hs-identifier hs-var">patGroup</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#WildPat"><span class="hs-identifier hs-type">WildPat</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PatGroup
</span><a href="GHC.HsToCore.Match.html#PgAny"><span class="hs-identifier hs-var">PgAny</span></a></span><span>
</span><span id="line-1156"></span><span class="annot"><a href="GHC.HsToCore.Match.html#patGroup"><span class="hs-identifier hs-var">patGroup</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#BangPat"><span class="hs-identifier hs-type">BangPat</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PatGroup
</span><a href="GHC.HsToCore.Match.html#PgBang"><span class="hs-identifier hs-var">PgBang</span></a></span><span>
</span><span id="line-1157"></span><span class="annot"><a href="GHC.HsToCore.Match.html#patGroup"><span class="hs-identifier hs-var">patGroup</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#NPat"><span class="hs-identifier hs-type">NPat</span></a></span><span> </span><span class="annot"><span class="annottext">XNPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#OverLit"><span class="hs-identifier hs-type">OverLit</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">ol_val :: forall p. HsOverLit p -&gt; OverLitVal
</span><a href="GHC.Hs.Lit.html#ol_val"><span class="hs-identifier hs-var">ol_val</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681143308"><span class="annot"><span class="annottext">OverLitVal
</span><a href="#local-6989586621681143308"><span class="hs-identifier hs-var">oval</span></a></span></span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681143307"><span class="annot"><span class="annottext">Maybe (SyntaxExpr GhcTc)
</span><a href="#local-6989586621681143307"><span class="hs-identifier hs-var">mb_neg</span></a></span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1158"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OverLitVal
</span><a href="#local-6989586621681143308"><span class="hs-identifier hs-var">oval</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe SyntaxExprTc -&gt; Bool
forall a. Maybe a -&gt; Bool
</span><a href="../../base/src/Data.Maybe.html#isJust"><span class="hs-identifier hs-var">isJust</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (SyntaxExpr GhcTc)
Maybe SyntaxExprTc
</span><a href="#local-6989586621681143307"><span class="hs-identifier hs-var">mb_neg</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1159"></span><span>   </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#HsIntegral"><span class="hs-identifier hs-type">HsIntegral</span></a></span><span>   </span><span id="local-6989586621681143304"><span class="annot"><span class="annottext">IntegralLit
</span><a href="#local-6989586621681143304"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Rational -&gt; PatGroup
</span><a href="GHC.HsToCore.Match.html#PgN"><span class="hs-identifier hs-var">PgN</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Rational
forall a. Num a =&gt; Integer -&gt; a
</span><a href="../../base/src/GHC.Num.html#fromInteger"><span class="hs-identifier hs-var">fromInteger</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IntegralLit -&gt; Integer
</span><a href="GHC.Types.Basic.html#il_value"><span class="hs-identifier hs-var hs-var">il_value</span></a></span><span> </span><span class="annot"><span class="annottext">IntegralLit
</span><a href="#local-6989586621681143304"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1160"></span><span>   </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#HsIntegral"><span class="hs-identifier hs-type">HsIntegral</span></a></span><span>   </span><span id="local-6989586621681143303"><span class="annot"><span class="annottext">IntegralLit
</span><a href="#local-6989586621681143303"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Rational -&gt; PatGroup
</span><a href="GHC.HsToCore.Match.html#PgN"><span class="hs-identifier hs-var">PgN</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">-</span><span class="annot"><span class="annottext">Integer -&gt; Rational
forall a. Num a =&gt; Integer -&gt; a
</span><a href="../../base/src/GHC.Num.html#fromInteger"><span class="hs-identifier hs-var">fromInteger</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IntegralLit -&gt; Integer
</span><a href="GHC.Types.Basic.html#il_value"><span class="hs-identifier hs-var hs-var">il_value</span></a></span><span> </span><span class="annot"><span class="annottext">IntegralLit
</span><a href="#local-6989586621681143303"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1161"></span><span>   </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#HsFractional"><span class="hs-identifier hs-type">HsFractional</span></a></span><span> </span><span id="local-6989586621681143301"><span class="annot"><span class="annottext">FractionalLit
</span><a href="#local-6989586621681143301"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Rational -&gt; PatGroup
</span><a href="GHC.HsToCore.Match.html#PgN"><span class="hs-identifier hs-var">PgN</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FractionalLit -&gt; Rational
</span><a href="GHC.Types.Basic.html#fl_value"><span class="hs-identifier hs-var hs-var">fl_value</span></a></span><span> </span><span class="annot"><span class="annottext">FractionalLit
</span><a href="#local-6989586621681143301"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1162"></span><span>   </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#HsFractional"><span class="hs-identifier hs-type">HsFractional</span></a></span><span> </span><span id="local-6989586621681143300"><span class="annot"><span class="annottext">FractionalLit
</span><a href="#local-6989586621681143300"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Rational -&gt; PatGroup
</span><a href="GHC.HsToCore.Match.html#PgN"><span class="hs-identifier hs-var">PgN</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">-</span><span class="annot"><span class="annottext">FractionalLit -&gt; Rational
</span><a href="GHC.Types.Basic.html#fl_value"><span class="hs-identifier hs-var hs-var">fl_value</span></a></span><span> </span><span class="annot"><span class="annottext">FractionalLit
</span><a href="#local-6989586621681143300"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1163"></span><span>   </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#HsIsString"><span class="hs-identifier hs-type">HsIsString</span></a></span><span> </span><span class="annot"><span class="annottext">SourceText
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143298"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681143298"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span class="hs-identifier">isNothing</span><span> </span><span class="hs-identifier">mb_neg</span><span class="hs-special">)</span><span>
</span><span id="line-1164"></span><span>                          </span><span class="annot"><span class="annottext">FastString -&gt; PatGroup
</span><a href="GHC.HsToCore.Match.html#PgOverS"><span class="hs-identifier hs-var">PgOverS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681143298"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-1165"></span><span class="annot"><a href="GHC.HsToCore.Match.html#patGroup"><span class="hs-identifier hs-var">patGroup</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#NPlusKPat"><span class="hs-identifier hs-type">NPlusKPat</span></a></span><span> </span><span class="annot"><span class="annottext">XNPlusKPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (IdP GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#OverLit"><span class="hs-identifier hs-type">OverLit</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">ol_val :: forall p. HsOverLit p -&gt; OverLitVal
</span><a href="GHC.Hs.Lit.html#ol_val"><span class="hs-identifier hs-var">ol_val</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681143296"><span class="annot"><span class="annottext">OverLitVal
</span><a href="#local-6989586621681143296"><span class="hs-identifier hs-var">oval</span></a></span></span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1166"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">OverLitVal
</span><a href="#local-6989586621681143296"><span class="hs-identifier hs-var">oval</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1167"></span><span>   </span><span class="annot"><a href="GHC.Hs.Lit.html#HsIntegral"><span class="hs-identifier hs-type">HsIntegral</span></a></span><span> </span><span id="local-6989586621681143295"><span class="annot"><span class="annottext">IntegralLit
</span><a href="#local-6989586621681143295"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; PatGroup
</span><a href="GHC.HsToCore.Match.html#PgNpK"><span class="hs-identifier hs-var">PgNpK</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IntegralLit -&gt; Integer
</span><a href="GHC.Types.Basic.html#il_value"><span class="hs-identifier hs-var hs-var">il_value</span></a></span><span> </span><span class="annot"><span class="annottext">IntegralLit
</span><a href="#local-6989586621681143295"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1168"></span><span>   </span><span class="annot"><span class="annottext">OverLitVal
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; PatGroup
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;patGroup NPlusKPat&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OverLitVal -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">OverLitVal
</span><a href="#local-6989586621681143296"><span class="hs-identifier hs-var">oval</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1169"></span><span class="annot"><a href="GHC.HsToCore.Match.html#patGroup"><span class="hs-identifier hs-var">patGroup</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#XPat"><span class="hs-identifier hs-type">XPat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#CoPat"><span class="hs-identifier hs-type">CoPat</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143294"><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143294"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="annot"><span class="annottext">Kind
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind -&gt; PatGroup
</span><a href="GHC.HsToCore.Match.html#PgCo"><span class="hs-identifier hs-var">PgCo</span></a></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Pat GhcTc -&gt; Kind
</span><a href="GHC.Tc.Utils.Zonk.html#hsPatType"><span class="hs-identifier hs-var">hsPatType</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143294"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1170"></span><span>                                                    </span><span class="hs-comment">-- Type of innelexp pattern</span><span>
</span><span id="line-1171"></span><span class="annot"><a href="GHC.HsToCore.Match.html#patGroup"><span class="hs-identifier hs-var">patGroup</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#ViewPat"><span class="hs-identifier hs-type">ViewPat</span></a></span><span> </span><span class="annot"><span class="annottext">XViewPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143293"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143293"><span class="hs-identifier hs-var">expr</span></a></span></span><span> </span><span id="local-6989586621681143292"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681143292"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; Kind -&gt; PatGroup
</span><a href="GHC.HsToCore.Match.html#PgView"><span class="hs-identifier hs-var">PgView</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681143293"><span class="hs-identifier hs-var">expr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Pat GhcTc -&gt; Kind
</span><a href="GHC.Tc.Utils.Zonk.html#hsPatType"><span class="hs-identifier hs-var">hsPatType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc) -&gt; Pat GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681143292"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1172"></span><span class="annot"><a href="GHC.HsToCore.Match.html#patGroup"><span class="hs-identifier hs-var">patGroup</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#ListPat"><span class="hs-identifier hs-type">ListPat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#ListPatTc"><span class="hs-identifier hs-type">ListPatTc</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(Kind, SyntaxExpr GhcTc)
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LPat GhcTc]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PatGroup
</span><a href="GHC.HsToCore.Match.html#PgOverloadedList"><span class="hs-identifier hs-var">PgOverloadedList</span></a></span><span>
</span><span id="line-1173"></span><span class="annot"><a href="GHC.HsToCore.Match.html#patGroup"><span class="hs-identifier hs-var">patGroup</span></a></span><span> </span><span id="local-6989586621681143291"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681143291"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#LitPat"><span class="hs-identifier hs-type">LitPat</span></a></span><span> </span><span class="annot"><span class="annottext">XLitPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143290"><span class="annot"><span class="annottext">HsLit GhcTc
</span><a href="#local-6989586621681143290"><span class="hs-identifier hs-var">lit</span></a></span></span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Literal -&gt; PatGroup
</span><a href="GHC.HsToCore.Match.html#PgLit"><span class="hs-identifier hs-var">PgLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; HsLit GhcTc -&gt; Literal
</span><a href="GHC.HsToCore.Match.Literal.html#hsLitKey"><span class="hs-identifier hs-var">hsLitKey</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681143291"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">HsLit GhcTc
</span><a href="#local-6989586621681143290"><span class="hs-identifier hs-var">lit</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1174"></span><span class="annot"><a href="GHC.HsToCore.Match.html#patGroup"><span class="hs-identifier hs-var">patGroup</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681143288"><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143288"><span class="hs-identifier hs-var">pat</span></a></span></span><span>                          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; PatGroup
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;patGroup&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Pat GhcTc -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681143288"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1175"></span><span>
</span><span id="line-1176"></span><span class="hs-comment">{-
Note [Grouping overloaded literal patterns]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
WATCH OUT!  Consider

        f (n+1) = ...
        f (n+2) = ...
        f (n+1) = ...

We can't group the first and third together, because the second may match
the same thing as the first.  Same goes for *overloaded* literal patterns
        f 1 True = ...
        f 2 False = ...
        f 1 False = ...
If the first arg matches '1' but the second does not match 'True', we
cannot jump to the third equation!  Because the same argument might
match '2'!
Hence we don't regard 1 and 2, or (n+1) and (n+2), as part of the same group.
-}</span><span>
</span><span id="line-1195"></span></pre></body></html>